Page MenuHomePhabricator

CodeMirror: HTML comment before first pipe in template ends template highlighting
Closed, DuplicatePublic

Description

Compare https://en.wikipedia.org/wiki/DeFuniak_Springs,_Florida?action=edit&veswitched=1&oldid=826376958 with https://en.wikipedia.org/wiki/DeFuniak_Springs,_Florida?action=edit&veswitched=1&oldid=827411703

Removing the HTML comments or adding a pipe before the HTML comments will highlight the rest of the infobox template correctly.

Event Timeline

Write unit tests before we look into this.

This is due to the block

			if ( haveAte && stream.sol() ) {
				// @todo error message
				state.nTemplate--;
				state.tokenize = state.stack.pop();
				return;
			}

in eatTemplatePageName()
If I remove it, things seem fine. I can't exactly tell what the purpose of this fragment is, but it has been there since the inception of the mode. @Kaartic any idea ?

This is due to the block

			if ( haveAte && stream.sol() ) {
				// @todo error message
				state.nTemplate--;
				state.tokenize = state.stack.pop();
				return;
			}

in eatTemplatePageName()
If I remove it, things seem fine. I can't exactly tell what the purpose of this fragment is, but it has been there since the inception of the mode. @Kaartic any idea ?

I pretty much do not remember contributing to Code Mirror nor having experience with it's code. Was that a wrong ping?