Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Multiple bold or italic sections in one string are not handled properly #33

Open
aantonovich opened this issue Oct 31, 2017 · 1 comment

Comments

@aantonovich
Copy link

String like "test str _first italic section_ some text _second italic section_ some later text" handled like
"test str first italic section_ some text _second italic section some later text"
Same problem related to bold sections.
To fix it regex should be corrected:
Instead of

        // Bold
        .replace(/\*(\S.*)\*/g, '**$1**')
        // Italic
        .replace(/\_(\S.*)\_/g, '*$1*')

Should be

        // Bold
        .replace(/\*(\S[^*]*)\*/g, '**$1**')
        // Italic
        .replace(/\_(\S[^_]*)\_/g, '*$1*')
@FokkeZB
Copy link
Owner

FokkeZB commented Oct 31, 2017

Excellent. Could you send a pull request?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants