jbt / markdown-editor

Live (Github-flavored) Markdown Editor
http://jbt.github.com/markdown-editor
ISC License
2.84k stars 645 forks source link

Unmatched < meant as Literal < Breaks Highlighting When inline HTML is Present #101

Closed Draco18s closed 5 years ago

Draco18s commented 5 years ago

For example:

|        Thing 1       |      Description      |
|----------------------|-----------------------|
| HTML | First some html.<ul><li>One</li><li>Twp</li></ul> |
| `<` | Don't do this, everything goes to hell |
| Other line | RED MODE ACTIVATED |
| `'` | No more red |

As it appears in the editor: image

Editable version

Note that the < cannot be replaced with &lt; as that displays as a literal &lt; and it's the single quotes in the text description that gets the red treatment, which will continue until either another ' is found (anywhere) or the end of the file is reached. Nor can the ' or '< be escaped (e.g. \' or \<).

This makes it particularly frustrating to edit the markdown page for a custom esolang where < one command and I require a bulleted list in the description for another command (as it does multiple things, based on its inputs) and the syntax highlighting in this case makes the text under it nearly impossible to read.

aero31aero commented 5 years ago

The simplest solution could be a mode where you can disable warnings and such highlights. Fixing the syntax highlighting would require diving into the source of codemirror or updating codemirror and seeing if the latest version has fixed it.

Unfortunately I don't have time these days for making a detailed fix, but a disable-warnings mode or subtler warning CSS is on the way.

On Mon, Jan 14, 2019, 10:32 PM Draco18s <notifications@github.com wrote:

For example:

Thing 1 Description
HTML First some html.
  • One
  • Twp
< Don't do this, everything goes to hell
Other line RED MODE ACTIVATED
' No more red

As it appears in the editor: [image: image] https://user-images.githubusercontent.com/1750680/51127043-30cc6b00-17ea-11e9-8167-a16a5ce499dc.png

Editable version https://jbt.github.io/markdown-editor/#dY7NCsIwEITvPsXcvNgW76FQrKJgLUjw5KGgSxNIE0lWRejDm/4cdS87u8s3Oz3mkkrbFut56qdWUrh5/WDt7Lxf9MnP+rNOIoC9rI7Rcad9YATXERR3JhVPkwuj89qSyGIftHw/Jp3F4/ANzVU0ES6dXTLuDqx0WIFe5D88Rm4dBbCDImNGomZFHkZbitx5W6Kqyy2KjTxcChnH0TUfTE8OnfMET/cUB16GmHGgvg==

Note that the < cannot be replaced with < as that displays as a literal < and it's the single quotes in the text description that gets the red treatment, which will continue until either another ' is found (anywhere) or the end of the file is reached. Nor can the ' or '< be escaped (e.g. \' or \<).

This makes it particularly frustrating to edit the markdown page for a custom esolang where < one command and I require a bulleted list in the description for another command (as it does multiple things, based on its inputs) and the syntax highlighting in this case makes the text under it nearly impossible to read.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jbt/markdown-editor/issues/101, or mute the thread https://github.com/notifications/unsubscribe-auth/AHqT1urs3Wo2lHDCHYwB2P_rxkzZlsOtks5vDLgSgaJpZM4Z-8oG .

Draco18s commented 5 years ago

Turning off syntax highlighting would be sufficient for me. I totally get the "not having time" thing. *not so subtle glance at ever-growing pile of own-projects going untouched.* Only ran into your editor because this markdown editor was not rendering the inline HTML at all so I went looking for something else.

cmnguyen01 commented 5 years ago

so what would you recommend to add in the codemirror files to implement the changes? I created the disable warning button but would like to know the functionality so I can attempt this issue.

aero31aero commented 5 years ago

Hey, I noticed you closed your PR so I pushed a minor fix here. I'd be happy to review any further changes you have in mind for this.

Draco18s commented 5 years ago

The live version hasn't updated yet (probably github's caching) but injecting the change at least lets me read the text in those regions. image So, that's fine for now.

aero31aero commented 5 years ago

Yeah, I haven't deployed the changes yet. It should be live soon.

On Sat, Oct 26, 2019, 7:57 PM Draco18s notifications@github.com wrote:

The live version hasn't updated yet (probably github's caching) but injecting the change at least lets me read the text in those regions. [image: image] https://user-images.githubusercontent.com/1750680/67621086-cdd51f00-f7d2-11e9-979d-d2df87c4bb56.png So, that's fine for now.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jbt/markdown-editor/issues/101?email_source=notifications&email_token=AB5JHVWCHSSE3MMZULLXBEDQQRHVFA5CNFSM4GP3ZIDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECKJFQY#issuecomment-546607811, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5JHVTR4BLCZ2TJW5D7XILQQRHVFANCNFSM4GP3ZIDA .