mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
68.79k stars 6.08k forks source link

Allow Colon Characters in Period, Sections, and Event Text #5418

Open FutzMonitor opened 3 months ago

FutzMonitor commented 3 months ago

:bookmark_tabs: Summary

This PR seeks to allow users to include colon characters in their period, section, and event element text.

Resolves #4175

:straight_ruler: Design Decisions

  1. I added a new function replaceEscapedColon() which transforms ESC_COLON into a colon character.
  2. I made changes to the documentation to guide users on how to include colon characters in their period, section, and event element text while also letting users know that this cannot be done for titles.

:clipboard: Tasks

Make sure you

netlify[bot] commented 3 months ago

Deploy Preview for mermaid-js ready!

Name Link
Latest commit 1c32828f752d1f976a03c329030915bced736984
Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/66750666a13aad00089140af
Deploy Preview https://deploy-preview-5418--mermaid-js.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

FutzMonitor commented 3 months ago

I have not added the necessary tests for this change to the timeline diagram. I was hoping to get some pointers on how to create tests for this new functionality because the timeline diagram has no rendering tests like some other diagrams. The timeline.spec.js file currently only tests the parser but this functionality is implemented during rendering.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 5.74%. Comparing base (9f37513) to head (e529cbd).

:exclamation: Current head e529cbd differs from pull request most recent head 1c32828

Please upload reports for the commit 1c32828 to get more accurate results.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5418/graphs/tree.svg?width=650&height=150&src=pr&token=BaET4V1BdM&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js)](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5418?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) ```diff @@ Coverage Diff @@ ## develop #5418 +/- ## ========================================== + Coverage 5.73% 5.74% +0.01% ========================================== Files 279 277 -2 Lines 42030 41908 -122 Branches 491 489 -2 ========================================== - Hits 2409 2407 -2 + Misses 39621 39501 -120 ``` | [Flag](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5418/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) | Coverage Ξ” | | |---|---|---| | [unit](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5418/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) | `5.74% <0.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5418?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) | Coverage Ξ” | | |---|---|---| | [packages/mermaid/src/diagrams/timeline/svgDraw.js](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5418?src=pr&el=tree&filepath=packages%2Fmermaid%2Fsrc%2Fdiagrams%2Ftimeline%2FsvgDraw.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js#diff-cGFja2FnZXMvbWVybWFpZC9zcmMvZGlhZ3JhbXMvdGltZWxpbmUvc3ZnRHJhdy5qcw==) | `0.00% <0.00%> (ΓΈ)` | | ... and [28 files with indirect coverage changes](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5418/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js)
sidharthv96 commented 3 months ago

@FutzMonitor I see some rendering tests in cypress/integration/rendering/timeline.spec.ts.

FutzMonitor commented 3 months ago

@FutzMonitor I see some rendering tests in cypress/integration/rendering/timeline.spec.ts.

Thank you, I'll take a look at it and add a test for my changes.

argos-ci[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Argos notifications β†—οΈŽ

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 616 added Jun 21, 2024, 5:01 AM