Repository navigation
perf(frontmatter): replace the quadratic front matter regex on hot paths - #8203
Conversation
frontMatterRegex backtracks polynomially (CodeQL js/polynomial-redos). Its opening `\s*[\n\r]` is ambiguous — `\s*` also consumes line breaks — so every failed search for a closing fence backtracks into it, and each of the O(n) split points rescans the lazy body. On '---\n' + ' \n'.repeat(n), well inside the default 50k maxTextSize, that is 35ms / 145ms / 582ms / 1269ms at n = 4k / 8k / 16k / 24k. It is reachable from detectType() on raw input. matchFrontMatter is a linear scanner that reproduces the regex result rather than a tidier reading of it, so no document changes how it is stripped: the opening ends at the last line break that still leaves a closing fence behind, and the body ends at the first fence after that. Same input: 1.3ms / 2.0ms / 2.8ms / 1.5ms. frontMatterRegex stays exported and unchanged — it is published surface, and the tests use it as the equivalence oracle over a hand-written corpus plus 3000 random fence-and-whitespace strings. Also takes the minimum rather than the mean of the timed runs in the existing stripAnyComments scaling test; the mean made it flaky under parallel workers. Closes mermaid-js#8200 Assisted-by: Claude (Anthropic) Signed-off-by: Fadhlan <fadhlanzap@gmail.com>
Assisted-by: Claude (Anthropic) Signed-off-by: Fadhlan <fadhlanzap@gmail.com>
🦋 Changeset detectedLatest commit: 139f470 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds a linear ChangesFront-matter scanner
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant InputText
participant matchFrontMatter
participant detectType
participant extractFrontMatter
InputText->>matchFrontMatter: scan text
matchFrontMatter-->>detectType: indent, body, length
matchFrontMatter-->>extractFrontMatter: indent, body, length
detectType->>detectType: slice front matter and strip comments
extractFrontMatter->>extractFrontMatter: dedent body and slice remaining text
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8203 +/- ##
===========================================
+ Coverage 80.73% 80.74% +0.01%
===========================================
Files 619 619
Lines 84970 85030 +60
Branches 18596 16115 -2481
===========================================
+ Hits 68601 68659 +58
- Misses 15350 15352 +2
Partials 1019 1019
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Resolves the conflict in packages/mermaid/src/diagram-api/regexes.spec.ts. Both sides made the same fix for the same flake, in different shapes: develop inlined a min-over-trials loop in `stripAnyComments`'s `measure`, this branch extracted a `fastestRun` helper it also uses for `matchFrontMatter`. Kept the helper and gave it develop's sampling: minimum over 5 trials of the mean of 5 calls, rather than the minimum of 5 single calls. Develop's `it.each` (which dropped the non-discriminating "deep indents" shape) is taken as-is.
|
Rebased onto latest The only conflict was in Resolution keeps the helper and adopts Verified after the merge: |
|
Hi @MFA-G, [sisyphos-bot] What's Working Well 🎉 [praise] The seeded PRNG for 3000 random equivalence tests is the right design choice for a scanner that must reproduce a regex byte-for-byte. It's deterministic (a failing seed is self-documenting), cheap to run, and reaches inputs 🎉 [praise] The fastestRun refactor (min-over-mean) is a real improvement over the existing stripAnyComments scaling test, and the motivation is exactly right: a single GC pause inflates an average irreversibly but leaves the minimum 🎉 [praise] Keeping frontMatterRegex exported and byte-for-byte unchanged with a comment that redirects internal callers to matchFrontMatter is the correct treatment of published surface. It also doubles as the equivalence oracle in 🎉 [praise] The long docstring above matchFrontMatter explaining why the scanner reproduces backtracking behavior rather than a cleaner semantics — specifically, the opening-swallows-multiple-line-breaks divergence case — is exactly 🎉 [praise] The PR description's measurement table (34.6ms / 144.9ms / 581.7ms / 1269.0ms at n=4k/8k/16k/24k → 1.33ms / 1.99ms / 2.78ms / 1.54ms) makes the perf claim concrete and independently checkable. The proof that "two forward Correctness Verification (Key Cases) I traced the algorithm manually through the behavioral divergence case from issue #8200: '---\n\n---\n\nMORE\n---\n'
The whole string is consumed — matching the regex's backtracking result. ✓ CRLF case ('---\r\ntitle: CRLF\r\n---\r\ngraph TD\n'):
Caller Changes detectType.ts: The swap from text.replace(frontMatterRegex, '') to text.slice(frontMatter.length) is semantically equivalent — frontMatterRegex is ^-anchored with no /g flag, so it only matches once at the start. The length field frontmatter.ts: match.indent → matches[1], match.body → matches[2], match.length → matches[0].length. All mappings are correct; the dedent logic is unchanged. ✓ Security (XSS sub-agent result pending — incorporating in final verdict below.) The matchFrontMatter scanner returns slices of the original string — no new content is introduced. match.body flows to yaml.load() with JSON schema restriction, same as before. match.indent is used only for string prefix checks No XSS or injection issues identified. Tests The new tests are thorough:
The scaling test correctly uses matchFrontMatter(input) as a warm-up call before fastestRun, avoiding JIT compilation cost in the measurement. ✓ Minor Notes (Non-blocking) 💡 [suggestion] openingEnds accumulates all line-break positions in the opening's whitespace run, but only the largest one below lastClosingFence is used. For inputs with a very long all-whitespace run after the opening ---, this is an Self-Check
Verdict: APPROVE |
|
@MFA-G, Thank you for the contribution! |
perf(frontmatter): replace the quadratic front matter regex on hot paths
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Upstream release: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4012.1.0 Release notes: ### Minor Changes - [#8303](mermaid-js/mermaid#8303) [`9140716`](mermaid-js/mermaid@9140716) Thanks [@filipsajdak](https://github.com/filipsajdak)! - feat: add the `elk.orientFeedbackEdges` option, enabled by default. With the ELK layout, an edge from a node that a subgraph feeds back into that subgraph is now routed downstream instead of around the subgraph. This changes the layout of existing ELK diagrams that contain such edges; set `elk.orientFeedbackEdges: false` to keep the previous routing. - [#8250](mermaid-js/mermaid#8250) [`fd4f5f2`](mermaid-js/mermaid@fd4f5f2) Thanks [@kartben](https://github.com/kartben)! - feat: add a `bitOrder` option to packet diagrams. It defaults to `ascending`, which is the current behaviour, and `descending` mirrors every row so it reads from that row's highest bit down to its lowest. Fields are still declared lowest bit first and keep their width, so switching a diagram between the two conventions only means changing `bitOrder`. ### Patch Changes - [#8330](mermaid-js/mermaid#8330) [`50c9e55`](mermaid-js/mermaid@50c9e55) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade chevrotain to 13 so mermaid no longer pulls in vulnerable `lodash-es@4.17.23` - [#8259](mermaid-js/mermaid#8259) [`4c90f5c`](mermaid-js/mermaid@4c90f5c) Thanks [@afonsojanu](https://github.com/afonsojanu)! - fix(sequence): allow whitespace between an actor name and its `@{ ... }` config object `participant Bob@{ "type" : "database" }` parsed fine, but adding a single space before the config object (`participant Bob @{ "type" : "database" }`) failed with a confusing parse error, even though the plain form without a config object tolerates trailing whitespace just fine. - [#8339](mermaid-js/mermaid#8339) [`c7fa1a5`](mermaid-js/mermaid@c7fa1a5) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: keep ELK class-diagram cardinalities off namespace frames - [#8334](mermaid-js/mermaid#8334) [`d67331d`](mermaid-js/mermaid@d67331d) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix(class): place cardinality labels beside their relation ends on dagre's sides with ELK, centre dagre's end labels, and stop clipping their text - [#8344](mermaid-js/mermaid#8344) [`99a050b`](mermaid-js/mermaid@99a050b) Thanks [@pbrolin47](https://github.com/pbrolin47)! - fix: with the ELK layout, an edge label could sit up to 16px beside its edge instead of centred on it, when the edge's terminal jog was straightened after the label's position was computed. The label is now re-projected onto the straightened route - [#8276](mermaid-js/mermaid#8276) [`3101c7d`](mermaid-js/mermaid@3101c7d) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(error): show the actual error message in the error diagram When a diagram fails to parse, the error diagram now draws the real error message below the "Syntax error in text" headline, wrapped to at most four lines. Hosts that only show the SVG (GitHub, GitLab, Obsidian, exported images) no longer hide what actually went wrong, e.g. that the flowchart edge limit was exceeded and `maxEdges` needs raising via `mermaid.initialize`. - [#8296](mermaid-js/mermaid#8296) [`aa29345`](mermaid-js/mermaid@aa29345) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: preserve explicit source relations on event modeling reset frames - [#8297](mermaid-js/mermaid#8297) [`967bbde`](mermaid-js/mermaid@967bbde) Thanks [@pentaoa](https://github.com/pentaoa)! - fix: reject duplicate event modeling frame IDs before rendering - [#8337](mermaid-js/mermaid#8337) [`147f343`](mermaid-js/mermaid@147f343) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: a flowchart that declares the same subgraph id more than once now renders as one merged subgraph with the ELK layout instead of producing NaN geometry. Classes and `view: collapsed` set on a repeated subgraph now apply to it, whichever declaration they follow. - [#8203](mermaid-js/mermaid#8203) [`40ef7b4`](mermaid-js/mermaid@40ef7b4) Thanks [@MFA-G](https://github.com/MFA-G)! - perf(frontmatter): replace the quadratic front matter regex on hot paths `frontMatterRegex` backtracks polynomially on whitespace-heavy input, so a diagram well inside the default `maxTextSize` could stall parsing for over a second. `detectType` and `extractFrontMatter` now use a linear scanner that matches the regex result exactly, leaving no document stripped differently. - [#8254](mermaid-js/mermaid#8254) [`351d7d2`](mermaid-js/mermaid@351d7d2) Thanks [@galshir](https://github.com/galshir)! - fix: warn when a gantt task references an unknown `after`/`until` task id, or when its end value is neither a valid date nor a valid duration - [#8249](mermaid-js/mermaid#8249) [`b657a2c`](mermaid-js/mermaid@b657a2c) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow hyphenated actor and participant names when a config object is attached - [#8300](mermaid-js/mermaid#8300) [`c38a565`](mermaid-js/mermaid@c38a565) Thanks [@filipsajdak](https://github.com/filipsajdak)! - fix: A partial override of an object-valued theme variable such as `xyChart`, `radar` or `cynefin` keeps the values the theme generates for the keys it leaves out - [#8333](mermaid-js/mermaid#8333) [`8afd83c`](mermaid-js/mermaid@8afd83c) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: upgrade the parser to langium 4.4 / chevrotain 13 so bundles no longer include `lodash-es@4.17.23` - [#8285](mermaid-js/mermaid#8285) [`859f1f8`](mermaid-js/mermaid@859f1f8) Thanks [@mir-ashiq](https://github.com/mir-ashiq)! - fix(sequence): allow actor-menu keywords as participant ids in messages A participant declared as `Link` (or `Links`, `Properties`, `Details`) could not be used as a message endpoint: the lexer matched the name as the `link` statement keyword and the parse failed. The `link`, `links`, `properties` and `details` keywords are now only recognized when an actor follows them on the same line, so participant ids that happen to spell these words work in messages, while the statements themselves keep parsing as before. - [#8282](mermaid-js/mermaid#8282) [`b6d952d`](mermaid-js/mermaid@b6d952d) Thanks [@belomaxorka](https://github.com/belomaxorka)! - fix(sequence): allow `Link` as a participant ID in messages and actor menus Preserve the ID's case and alias while keeping the `link` and `links` menu commands supported. - [#8345](mermaid-js/mermaid#8345) [`7917c1a`](mermaid-js/mermaid@7917c1a) Thanks [@knsv-bot](https://github.com/knsv-bot)! - fix: xychart measures text in SVG units so legends no longer clip on wide charts scaled to fit their container, and the chart title is dropped instead of overflowing when the chart is too short for it - [#8338](mermaid-js/mermaid#8338) [`4a722fb`](mermaid-js/mermaid@4a722fb) Thanks [@ashishjain0512](https://github.com/ashishjain0512)! - fix: Centre the xychart title over the plot area instead of the whole chart - Updated dependencies \[[`8afd83c`](mermaid-js/mermaid@8afd83c)]: - @mermaid-js/parser@2.0.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: give me a 98K <240642031+inhuman-0@users.noreply.github.com>
Description
Closes #8200 —
frontMatterRegexbacktracks polynomially (CodeQLjs/polynomial-redos).The opening
\s*[\n\r]is ambiguous:\s*can also consume line breaks, so every failed search for a closing fence backtracks into it, and each of the O(n) split points then rescans the lazy body. Measured on'---\n' + ' \n'.repeat(n), which fits inside the default 50kmaxTextSize:frontMatterRegexmatchFrontMatterIt is reachable from
detectType()on raw user input.Approach
Same shape as the
stripAnyCommentsfix in #7906: a linear scanner replaces the regex on the hot paths, and the regex stays as the test oracle.As the issue notes, a linear rewrite is not automatically behaviour-preserving — de-ambiguating the opening changes which fence closes the block. So
matchFrontMatterreproduces the backtracking result rather than a tidier reading of it. The engine tries the longest opening first and shortens it one line break at a time, which is equivalent to:---that still leaves a closing fence after it;That is why the divergence example from the issue,
'---\n\n---\n\nMORE\n---\n', is still stripped whole: the opening swallows both leading line breaks, the second---lands inside the body, and only the third can close. No document changes how it is stripped.Two forward passes, each visiting a character a bounded number of times — the trailing whitespace runs of two closing fences cannot overlap, since
---separates them.frontMatterRegexremains exported and byte-for-byte unchanged; it is published surface, and removing it would be a separate breaking decision. A comment now points internal callers at the scanner.Changes
regexes.ts— addmatchFrontMatter, returning{ indent, body, length }(the regex's groups 1, 2 and match length).detectType.ts,frontmatter.ts— the two callers that matched the regex on user input.regexes.spec.ts— equivalence againstfrontMatterRegexover a hand-written corpus (CRLF, tab indent, indented---inside a multi-line scalar per Sankey diagram throws "Syntax error in text" with sankey keyword (missing hyphen) #7613, the frontMatterRegex is polynomial on whitespace-heavy input (ReDoS, CodeQL js/polynomial-redos) #8200 divergence, unterminated blocks, four-dash fences, mismatched indents) plus 3000 random fence-and-whitespace strings from a seeded PRNG, and a scaling assertion.Also here
The existing
stripAnyCommentsscaling test took the mean of its timed runs, which made it flake under parallel workers (I hit it at 28x on an otherwise-clean tree). Both scaling tests now take the minimum, which reports the run that was not interrupted. This is a test-only change; the ratio bar of 8 is untouched.Validation
vitest run packages/mermaid/src/diagram-api/→ 60 passed.vitest run packages/mermaid/src/→ same failures asdevelop(unbuilt@mermaid-js/parserworkspace dep locally); no new ones. Diffed the failing-file lists against a stashed tree to confirm.Summary
frontMatterRegexwith the linearmatchFrontMatterscanner.detectTypeandextractFrontMatter.frontMatterRegexunchanged for compatibility.