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 Hashtags in Timeline Titles, Sections, and Events #5399

Open FutzMonitor opened 3 months ago

FutzMonitor commented 3 months ago

:bookmark_tabs: Summary

This pull request removes the hashtag from the title, section, and event regex so that hashtags can be used in their text content. The period element were not included because of an inconsistency. Whereas you can put a hashtag anywhere in the string for a title, section, and event, the period element begins a line and thus is counted as comment.

These changes were made to allow for hashtags in the timeline diagram and to address the inconsistency between percent comments and hashtag comments. This way functionality isn't outright broken with a new comment notation ## versus #.

Resolves #5356 .

:straight_ruler: Design Decisions

I simply removed the hashtag symbol from the exclusion clause regex for the title, section, and event. I made sure to add test coverage to the timeline test suite and run pnpm test to ensure that it was still working.

:clipboard: Tasks

Make sure you

netlify[bot] commented 3 months ago

Deploy Preview for mermaid-js ready!

Name Link
Latest commit d1a3a84b6f472d7d469780bd567b30aa086af6ee
Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/660864333b1c540008668f85
Deploy Preview https://deploy-preview-5399--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.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 5.74%. Comparing base (8e95c4d) to head (d1a3a84).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5399/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/5399?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 #5399 +/- ## ======================================= Coverage 5.74% 5.74% ======================================= Files 277 276 -1 Lines 41899 41888 -11 Branches 489 514 +25 ======================================= Hits 2407 2407 + Misses 39492 39481 -11 ``` | [Flag](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5399/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) | Coverage Ξ” | | |---|---|---| | [e2e](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5399/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js) | `?` | | | [unit](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5399/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.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. [see 1 file with indirect coverage changes](https://app.codecov.io/gh/mermaid-js/mermaid/pull/5399/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=mermaid-js)