Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Greyed out lines when after <de> #278

Closed
ghost opened this issue Jan 9, 2020 · 5 comments
Closed

Greyed out lines when after <de> #278

ghost opened this issue Jan 9, 2020 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 9, 2020

following code

abc <de>
greyed_out_line_1
greyed_out_line_2

makes Abricotine enclose following lines to be enclosed in grey box.

@brrd
Copy link
Owner

brrd commented Jan 9, 2020

The grey background indicates html code. In markdown tags are interpreted as html (this is a part of the original specs).
Most markdown parsers would produce the following html export from your code:

<p>abc <de> greyed_out_line_1 greyed_out_line_2</de></p>

You can use this solution: https://stackoverflow.com/questions/41705811/how-do-i-type-html-in-a-markdown-file-without-it-rendering

Having said that, the grey background will probably be removed in a future release due to another issue (#274).

@brrd brrd closed this as completed Jan 9, 2020
@ghost
Copy link
Author

ghost commented Jan 9, 2020

You don't need to insert html tag to produce this bug. If you change <de> to <de next two lines will still be greyed out.

@brrd
Copy link
Owner

brrd commented Jan 10, 2020

<de is considered as the beginning of an html tag, so the following line is actually the contents of the tag. It's the way CodeMirror is parsing markdown.
If you really think this is an issue then please report it to CodeMirror project: https://github.com/codemirror/CodeMirror/issues

@ghost
Copy link
Author

ghost commented Jan 10, 2020

According to HTML syntax <de is not a tag. You can't just take some random string and say it is a tag. Same you could say that de> is a tag but it's not. No editor I know will color part of any programming language because it could be part of syntax. e.g. no language will colorize fo because it could be for. If you enter whole keyword "for" only then it will be colored. If you start typing fo you might just end it's differently e.g. foo which is not keyword so it does not make sense to colorize fo because it is prefix of some keyword.

@brrd
Copy link
Owner

brrd commented Jan 11, 2020

This is valid XML:

<div
  id="foo"
  class="bar"
  hello
  world
>
baz
</div>

If you are interested in this subject, I recommend that you read Marijn Haverbeke's articles on parsing, which explain why it is difficult with the current CodeMirror parser to process certain ambiguous multiline expressions: https://marijnhaverbeke.nl/blog/#parsing

This should evolve in the next CodeMirror though.

And if you really want to nitpick about details, please contact the contributors responsible for this part of the code directly: https://github.com/codemirror/CodeMirror/issues

I'm locking this conversation because I don't think it will be useful for Abricotine development.

Repository owner locked and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant