markdown icon indicating copy to clipboard operation
markdown copied to clipboard

Request: Allow TagSyntax with unmatched tags

Open brianrobles204 opened this issue 4 years ago • 0 comments

Hello,

I'm trying to implement reddit's superscript syntax as a custom inline syntax. Since superscript text can have other tags inside of it, I need to use the TagSyntax API, but the API usually expects some closing tag, whereas superscript text like ^example works without one.

I'd also like to handle cases like **^example** where the superscript should be recognized before any spaces or line ends, instead of being flattened out by the strong tag.

I think the best way to include this feature this would be a special case within TagState.close, where we check each unmatched TagSyntax if they want to optionally handle how they're closed, instead of just flattening all of them into the closing tag. I can try writing a PR if this sounds like a good idea. Thanks!

brianrobles204 avatar Jan 02 '21 07:01 brianrobles204