You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 2, 2018. It is now read-only.
Currently bbcode-mode only colors matching pairs of opening/closing tags. It doesn't color orphaned opening or closing tags at all (i.e. an opening tag without a matching closing tag or vice versa). This can be quite confusing to newcomers since the behavior is different from popular Emacs modes like xml-mode, html-mode and web-mode, all of which color orphaned tags as well as properly paired ones. (xml-mode goes a step further and colors orphaned closing tags in red to highlight that there's a syntax error, but that's tricky to do.)
As a related issue, bbcode-mode tries to implement tag pair matching using a regexp. This does not work properly with nested tags - in particular, nested [quote]s are problematic. It's very difficult if not impossible to properly parse nested structures using regexps.
In light of these points, I'd like to propose that the font-lock patterns should simply match individual opening/closing tags and not worry about pairing them up. This would make bbcode-modes font-lock behavior consistent with existing popular markup modes and would make the font-lock patterns much simpler to implement as well. What do you think?
The text was updated successfully, but these errors were encountered:
I see that when typing [b]foo[/b] the whole text is bolded which is nice. web-mode doesn't do that. html-mode seems like the best of both worlds: orphaned tags are colored and the foo part in <b>foo</b> is also bolded :) But it's not too ambitious: the foo part in <b><a href="x">foo</a></b> is not bolded. Maybe we could try going for this level of sophistication.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently
bbcode-mode
only colors matching pairs of opening/closing tags. It doesn't color orphaned opening or closing tags at all (i.e. an opening tag without a matching closing tag or vice versa). This can be quite confusing to newcomers since the behavior is different from popular Emacs modes likexml-mode
,html-mode
andweb-mode
, all of which color orphaned tags as well as properly paired ones. (xml-mode
goes a step further and colors orphaned closing tags in red to highlight that there's a syntax error, but that's tricky to do.)As a related issue,
bbcode-mode
tries to implement tag pair matching using a regexp. This does not work properly with nested tags - in particular, nested[quote]
s are problematic. It's very difficult if not impossible to properly parse nested structures using regexps.In light of these points, I'd like to propose that the font-lock patterns should simply match individual opening/closing tags and not worry about pairing them up. This would make
bbcode-mode
s font-lock behavior consistent with existing popular markup modes and would make the font-lock patterns much simpler to implement as well. What do you think?The text was updated successfully, but these errors were encountered: