Garry's SyntaxArea help needed for xml definition (sure regex help for Kem ...)

Hi @GarryPettet ,
(and hello @Kem_Tekinay !)

Using your very nice syntaxarea code, I found one problem
if you use the html syntax definition, then the <br> tag is not correctly defined
the </br> tag is not mandatory (as I know ) and so the indentation of the html text is not correct
if you insert a br without a /br

how is it possible to modify this ?


1 Like

Thanks for reporting the bug. It also affected <img> tags too.

Fixed in the latest commit.



@GarryPettet as a side note, it would be nice to have a “pure” SQL syntax definition, or is the postgres one large enough ?

Feel free to write one and make a pull request.

I rarely ever write SQL so I’m not best placed to create a definition for it. The one that is bundled is a direct port of the one that came with CustomEditField.

1 Like

just found that <meta> <input> deserve the same as <br> and <img>

I think meta is already in the regex.

ok it’s easy to add the missing ones…
changed the line 7 of html.xml
(?!&lt;link|&lt;meta|&lt;br|&lt;img)&lt;((?:\w|-)+)(?:[ ]+(?:\w|[-+"'#=:\\\.\/ ])+)?&gt;(?!.*&lt;\/(\1)&gt;)
(?!&lt;link|&lt;meta|&lt;br|&lt;img|&lt;input)&lt;((?:\w|-)+)(?:[ ]+(?:\w|[-+"'#=:\\\.\/ ])+)?&gt;(?!.*&lt;\/(\1)&gt;)

1 Like