-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove zero width space U+200B in from code snippets #2206
Conversation
That may be intentional to keep it from triggering and including snippets. You can use snippets even in code blocks as snippets are run very early on. |
I am guessing you didn't run the documents and view how it looks after you made this change? |
Not up until now, sorry for that. I am getting an error when I try to run
|
I guess the way you did it here is the way to go:
|
Yeah, I did this thing where if you add a space at the end, it won't trigger, but then people would copy and paste it as an example without really reading about the whitespace part and then complain it doesn't work, so then I did it like you pointed out so they could copy it. It was just easier. It's a syntax I'd never really use anywhere else except to insert snippets (and obviously the one-time case where I explain how snippets work 🙂). |
Oh my 🤦♂️ I thought I'd be clever tricking the Snippets extension into not expanding the macro, but obviously haven't thought about users copy & pasting the code and wondering why it doesn't work. A better way is of course to just use the literal HTML, so Snippets won't expand it. However, I've found no way to make this work inside a tabbed container without messing up the formatting. If somebody could make this work without the zero-width whitespace, I'm happy to merge. Possible explanation for #2154. |
I created a working pull at #2207 |
When I tried to use
pymdownx.snippets
, and copied the code from the adding-a-glossary, the abbreviation docs wasn't included.Instead after serving the site locally I got no abbreviation underlines in the text followed by
I then realized that there is a "zero width space" character (U+200B) after the
--8<--
which prevented the snippets extension from correctly parsing the include.Notice the red dot after
--8<--
in the following screenshot:To see the hidden character I also used: https://www.soscisurvey.de/tools/view-chars.php
This PR removes those "zero width space" characters.