micromark / micromark-extension-directive

micromark extension to support generic directives (`:cite[smith04]`)
https://unifiedjs.com
MIT License
29 stars 16 forks source link

Ignore colon in words #26

Closed fhilgers closed 2 months ago

fhilgers commented 2 months ago

Initial checklist

Problem

The german language has different forms of words depending on the gender (example: Mitglieder male, Mitgliederinnen female). One modern variant of writing those, which is required in some formal contexts, is Mitglieder:innen with a colon separating the suffix. Currently this leads to unwanted directives.

Solution

I could not find a test, which explictly tests for a textDirective directly following a word. The only ones I could find was a textDirective directly after an opening bracket, which is essentially the start of a span and not after a letter.

I cannot think of a usecase, where one would want to have a textDirective, directly attached to a word. Also there are already strict requirements for the leafDirectives and containerDirectives to be directly at the start of a line. Also, all directives have to directly follow the colons with no space.

What is the reason for allowing textDirectives directly attached to a word? If there is none, I would like to require that a textDirective is not allowed when attached to a word.

Alternatives

ChristianMurphy commented 2 months ago

Welcome @fhilgers! 👋 Pretty much all markdown inline constructs can happen mid word


example*example*
example**example**
example`example`

exampleexample exampleexample exampleexample


And any of these can be escaped by adding a backslash \. I don't see a reason why this construct should be different from all the others.

fhilgers commented 2 months ago

Woops, that makes sense. In my mind the directive syntax felt so much like a function call from general programming languages that I found that behaviour weird. But you're definetly right!

github-actions[bot] commented 2 months ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] commented 1 month ago

Hi team! Could you describe why this has been marked as wontfix?

Thanks, — bb