Skip to content
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

Markdown italic indicator interpreted incorrectly #412

Open
crystalfp opened this issue Mar 28, 2019 · 11 comments
Open

Markdown italic indicator interpreted incorrectly #412

crystalfp opened this issue Mar 28, 2019 · 11 comments
Labels
Area: Editor theming Decorations and highlighting in editor. Issue: Bug

Comments

@crystalfp
Copy link

Create a markdown file containing:

blog: [sethgodin.typepad.com/seths_blog/2014/09/the-shameful-fraud-of-sorting-for-youth-meritocracy.html](http://sethgodin.typepad.com/seths_blog/2014/09/the-shameful-fraud-of-sorting-for-youth-meritocracy.html)

and open it in VSC. You will see the text between the two underscores (in seths_blog) rendered in bold. This makes a long page containing URLs with '_' unreadable.

The underscore should make the text italic like here. Instead inside a word (one_two_three) it makes the 'two' text bold (this does not happen here, but happens in VSC).

I have "markdown.extension.italic.indicator": "*" If that matters.

Thanks for considering!
mario

What is the problem?

Text between two underscores inside a word is rendered as bold.

How can I reproduce it?

See above

Is there any error message in the console?

No

@crystalfp crystalfp changed the title Markdown italic indicator interpreted incorrectly in URL Markdown italic indicator interpreted incorrectly Mar 28, 2019
@crystalfp
Copy link
Author

More data:
If I have "markdown.extension.syntax.decorations": false or
"markdown.extension.syntax.plainTheme": false The problem does not appear, but also the various styles are not visible in the text.

I repeat, this effect is really annoying inside URLs. I use the format [URL](URL) as in the example to make the links usable also in print.

Thanks again!

@yzhang-gh
Copy link
Owner

Looks no problem here. Could you do some more test, like disabling all the other extensions?


And here is a tip. You can use <URL> to get the same effect of [URL](URL) 😉

@crystalfp
Copy link
Author

No, with only your extension enabled it happens again
Annotation 2019-03-28 085416

Here is if you want to experiment:

- Franco Lorenzoni, “Appello perché bimbi e bimbe fino a 8 anni siano liberi da schermi e computer nella scuola” ([www.repubblica.it/scuola/2012/12/04/news/appello_perch_bambine_e_bambini_dai_3_agli_8_anni_siano_liberi_da_schermi_e_computer_nella_scuola_-48057286](http://www.repubblica.it/scuola/2012/12/04/news/appello_perch_bambine_e_bambini_dai_3_agli_8_anni_siano_liberi_da_schermi_e_computer_nella_scuola_-48057286)).

Sorry, forgot to look before, but in the log of the extension host there is an error from the extension:

[2019-03-28 06:42:23.531] [exthost] [error] onWillSaveTextDocument-listener from extension 'yzhang.markdown-all-in-one' threw ERROR
[2019-03-28 06:42:23.538] [exthost] [error] TypeError: Cannot read property 'document' of undefined
	at C:\Users\Mario Valle\.vscode\extensions\yzhang.markdown-all-in-one-2.2.0\dist\extension.js:1:1088686
	at Generator.next (<anonymous>)
	at module.exports.n (C:\Users\Mario Valle\.vscode\extensions\yzhang.markdown-all-in-one-2.2.0\dist\extension.js:1:1088208)
	at new Promise (<anonymous>)
	at module.exports.n (C:\Users\Mario Valle\.vscode\extensions\yzhang.markdown-all-in-one-2.2.0\dist\extension.js:1:1087985)
	at _ (C:\Users\Mario Valle\.vscode\extensions\yzhang.markdown-all-in-one-2.2.0\dist\extension.js:1:1088617)
	at g (C:\Users\Mario Valle\.vscode\extensions\yzhang.markdown-all-in-one-2.2.0\dist\extension.js:1:1091620)
	at c._deliverEventAsync (c:\Users\Mario Valle\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:420:588)
	at c._deliverEventAsyncAndBlameBadListeners (c:\Users\Mario Valle\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:419:794)
	at Array.define.$participateInSave.r.sequence.s.map.e (c:\Users\Mario Valle\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:419:508)
	at t (c:\Users\Mario Valle\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:47:803)

Side note. I know the tip, I should have written (as in the screenshot): [Simplified-url](URL)

Thanks for looking!
mario

@yzhang-gh
Copy link
Owner

After seeing the picture, I know that it is the plainTheme's problem (disabled by default because it is experimental). It is not that easy to fix. I will take a look this weekend.

@crystalfp
Copy link
Author

Thanks! In the meantime I disabled the plainTheme. That solved the problem with URL. Maybe I dare to suggest two things:

  1. to change the color of the bold words from blue, like the titles, to a different color like yellow.
  2. to explain what the plainTheme added to the rendering in the documentation.

Anyway thanks!

@crystalfp
Copy link
Author

crystalfp commented Mar 28, 2019

Could I add a related very minor thing? If you have a bold-italic word ***word*** The two inner asterisks are italicized, the other four not. Could the extension put all asterisks in the same style? All italic or all in normal font?

Thanks for your patience!
mario

@yzhang-gh
Copy link
Owner

to change the color of the bold words from blue, like the titles, to a different color like yellow.

It should have been white. Do you mean the URL alt text?

to explain what the plainTheme added to the rendering in the documentation.

This feature is from #185 originally (it is a long post). I didn't document it because I picked these "plain colours" only based on the Material Theme I am using. And there is no way to make it suitable for the various themes, I decided to leave it as is (default false and undocumented). Maybe we can add some notes in the README.

plain theme

***word***

Another technical challenge 😂. Probably I can't do much here. There will be more problems such as
**word *word* word**.

@crystalfp
Copy link
Author

Don't worry too much. I can live without them after turning off plainTheme.
Thanks!

yzhang-gh added a commit that referenced this issue Mar 30, 2019
@yzhang-gh
Copy link
Owner

yzhang-gh commented Mar 30, 2019

It should be fixed in the dev build.


Not really. The URL part is fixed. But there are conflicts in the alt text part.

image

@crystalfp
Copy link
Author

Good! This is one more step to make plain Theme usable:
underscore and url
I noticed a strange thing with italic (the usual single asterisk one). Outside this URL section it is rendered correctly:
asterisk outside
Instead inside the section it is like this (half bold and half URL color):
asterisk inside
Minor thing, but maybe could help you understand what happens outside the URL.
Thanks again!
mario

@crystalfp
Copy link
Author

Mmmm... this "italic half bold" seems happens at random in the text:
four
If you need it, I could extract a subset of the full text to demonstrate this. Just let me know.
Thanks!
mario

@Lemmingh Lemmingh added the Area: Editor theming Decorations and highlighting in editor. label Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Editor theming Decorations and highlighting in editor. Issue: Bug
Projects
None yet
Development

No branches or pull requests

3 participants