Skip to content

2 consecutive * or _ should probably raise an error? #391

Closed

Description

@user202729

Coming from Markdown (variant), I was a bit surprised to see that **bold** gives the same as bold, i.e. nothing changed.

After thinking about it for a while I realize that ** is *<nothing>*, so there's an empty text being bolded.

Nevertheless I think **...** is a common notation, so it may be better to explicitly give an error on it instead of silently ignore.

Activity

  1. laurmaedje commented on Mar 28, 2023

    @laurmaedje
    Member

    Does it give the same result for you? It should not be bold anymore because the two sets of stars are two empty bold parts.

  2. user202729 commented on Mar 28, 2023

    @user202729
    ContributorAuthor

    I mean, yes it gives two empty bold parts (thus nothing is bold). But it makes more sense to raise an error because that's almost-never what the user want.

  3. mateusfccp commented on Mar 28, 2023

    @mateusfccp
    Contributor

    I disagree this should be an error. It's syntactically valid and it's up to the user to know the language they are writing in. If you don't like the syntax, you may use #strong(...) instead.

  4. user202729 commented on Mar 28, 2023

    @user202729
    ContributorAuthor

    It's good practice to give a warning/error when what is written is likely not what the user want, rather than silently do something that the user does not want.

    Unless in very special circumstances (e.g. automated document generation), ** is not useful and the user could as well delete both the stars.

    Even in the case of automated document generation, if the programmer want to allow empty text inside it is possible to simply use #strong([...]).

  5. added
    diagnostics
    on Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    diagnostics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions