Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeline Diagram Comment Inconsistencies #5356

Closed
FutzMonitor opened this issue Mar 4, 2024 · 0 comments · Fixed by #5399
Closed

Timeline Diagram Comment Inconsistencies #5356

FutzMonitor opened this issue Mar 4, 2024 · 0 comments · Fixed by #5399
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@FutzMonitor
Copy link
Contributor

FutzMonitor commented Mar 4, 2024

Description

Inside of the timeline.jison parser file, there are two ways of declaring comments: either you use the double percentage sign %% defined on line 14 or you use a singular hashtag # defined on line 18. If you use the hashtag method while writing within an event element, it will treat everything that comes after it as a comment. However, the double percentage method isn't treated this way. It's rendered despite being highlighted green within Mermaid live indicating its comment status. Additionally, the hashtag method isn't highlighted green which causes some visual confusion because a green highlight seems to indicate a comment.

Steps to reproduce

  1. You may visit this [link] for an example.
  2. If you just want to copy + paste it yourself, you can just copy and past this diagram to see what I'm talking about.
        title History of Social Media Platform
        2002 : LinkedIn
        2004 : Facebook
             : Google
        2005 : Youtube %% Hello
        2006 : Twitter # Hello
        %% I am a comment
        # Hello I am a comment

Screenshots

image

Code Sample

No response

Setup

  • Mermaid version: 10.8.0
  • Browser and Version: FireFox 123.0 (64-bit), Google Chrome Version 122.0.6261.95 (Official Build) (64-bit)

Suggested Solutions

A good solution would make alterations to the timeline.jison file so that hashtag/percent comments are both treated the same way. It's my personal belief that maybe hashtags should be required to be double ## (similar to Python). That way users could potentially use hashtag symbols in their titles, sections, periods, and event elements so long as they aren't two consecutive hashtag symbols. Admittedly, this would require extra effort as the regexs for the timeline, section, period, event, and other parts of the lexical definitions will need to be altered to support this change.

Additional Context

No response

@FutzMonitor FutzMonitor added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant