infitio / flutter_markdown

Minimalistic, highly customizable - regexp based Markdown widget for Flutter
Other
14 stars 6 forks source link

Example does not render `_How ya doin!_` properly #1

Open nalbion opened 5 years ago

nalbion commented 5 years ago

The example does not render _How ya doin!_ properly because ! is not in _baseCharacters.

Why not use RegExp(r"_[^_]+_") for italics?

...why not use a capturing group RegExp(r"_([^_]+)_") so that you don't need postProcess?

tiholic commented 5 years ago

@nalbion that sounds like a good idea 👍 Can you raise a PR with the changes?

nalbion commented 5 years ago

I've decided to go with Zefyr as it gives a WYSIWYG editor.

I managed to come up with a single regex for bold and italics: RegExp(r'((?:\*|_){1,3})(.*?[^\1 ])\1')

https://github.com/memspace/zefyr/pull/191/files#