Frederisk/Wikitext-VSCode-Extension

HTML comments with multiple hyphens confuse the wikitext interpreter

Californ1a opened this issue · 3 comments

Lines 13 and below shouldn't be commented out. Removing the extra hyphens fixes it:

Adding 1 extra hyphen to the end of line 12 breaks it:

Adding 1 to the start of line 12 doesn't break it, though adding 2 does.

This is in the design. In terms of syntax, the extension prefers XML and XHTML, so, as they stipulate for the content of comments: there should not be two consecutives dashed.

I'm not sure what theme you are using, but normally, the content with invalid syntax should be flagged.
image

It may be invalid in terms of proper XHTML syntax, but no wiki I know of breaks the syntax highlighting on-site if you don't follow that convention:

Wikipedia uses ■ instead of extra hyphens for spacing in their sandbox comment, but adding extra hyphens doesn't break the syntax highlighting:

Some probably have style guide policies for how comments should be formatted, but the syntax highlighting in the editor itself won't/shouldn't break if you don't follow those policy conventions. As far as I can tell, even Wikipedia's MOS never specifically mentions not to add more than 2 hyphens - it's not mentioned on either MOS:COMMENT or on MOS:HIDDEN.

The VSC theme I use is Atom one dark, but the standard HTML lang syntax highlighting doesn't break:

However, if I change the lang to XML, then it does:

To me, this is similar to leaving off the self-closing tag on <br />, <img /> etc., which is also invalid in proper XHTML, but the syntax highlighting shouldn't care about that because it's more of a style preference that should be a linter config rather than breaking syntax highlighting.

Well, I agree with you. After thinking about it, I decided to remove this restriction.