Closed nicbou closed 1 year ago
This line is the culprit: https://github.com/neurobin/mdx_wikilink_plus/blob/master/mdx_wikilink_plus/mdx_wikilink_plus.py#L148
However I dare not change it without understanding why it's there in the first place.
that is the expected behavior. For example, [my-google-example]
will become My Google Example
. If you want to change it, then you will have to add another config parameter label_clean_re
which defaults to r'[\s_-]+'
Is this based on the behaviour of other Wikilink implementations? Otherwise it would make more sense to keep the labels as-is. This is the behaviour I see on Wikipedia, for example. The label should be transformed to a link, but not to a different label, right?
Feel free to close this as wontfix. Since my need is very simple ([[hello world]]
> [hello world](/glossary/hello%20world)
), I can also write my own implementation.
[[hello world]] > [hello world](/glossary/hello%20world)
this example will work as you expect it when you set the label_case
config param to ''
;
Unless there are hyphens in the label. I'm wondering if this behaviour is common to wikilink implementations or a mdx_wikilink_plus bug.
that is the expected behavior. For example, [my-google-example]
will become My Google Example
. If you want to change it, then you will have to add another config parameter label_clean_re
which defaults to r'[\s_-]+'
Thanks for the clarification. In the end, the build_url
parameter in the original wikilinks extension handled my use case pretty well.
This wikilink:
Let's take the [[S-Bahn]]!
is rendered asLet's take the <a href="/glossary/S-Bahn">S Bahn</a>
. The hyphen is correctly preserved for the link, but replaced with a space in the label.This is my config: