Underline parser too greedy across line breaks

Testing version: Version 2.0.7

What were you doing: Using tildes (~) in plain text to mean approximately

What feature did you use: Plain text

What happened:
With the following input text (reflecting my real use case):

Lorem (~2 mb)
Ipsum (~4 mb)

Bear is treating the tildes as start and end markers for an underline, leading to this output:

Lorem (<u>2 mb)
Ipsum (</u>4 mb)

What did you expect to happen: I expected no markdown formatting to apply.

User-possible remedy: I can reformat my text as a bullet list. This seems to stop the underline pattern search. But I’d prefer to not change my writing content.

Drive-by parser suggestion: Maybe the underline pattern search can be tweaked so that a line break ends the search if the second tilde isn’t followed by white space.

Edit: Originally wrote “strikethrough” when I meant “underline”

1 Like

It’s weird, I can’t seem to reproduce this if I leave the parenthesis out of your example :sweat_smile: So this has to be some weird edge case, but bug nonetheless.

You can workaround this by adding a \ in front of one of your ~ as that works as a “treat the character after me as literal ~ and not a Markdown formatting character” and it’s basically invisible like other formatting characters.

Thanks for reporting! We will have a look and see if we can improve this.

Fixed. Will be part of a future release.