SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: Marcel on June 02, 2019, 10:10:15 PM

Title: SE 23.0.2 - XHTML - No surround-with templates found for selected language
Post by: Marcel on June 02, 2019, 10:10:15 PM
I would like to use the XML surround-with templates for XHTML files. How can I accomplish that?  My .xhtml extensions ARE mapped to xhtml (default is xml) because I have specific language settings for them.

To see SE's behavior, try export.xhtml from the attached sample project and select a few lines for a surround operation
Title: Re: SE 23.0.2 - XHTML - No surround-with templates found for selected language
Post by: patrick on June 05, 2019, 03:46:03 PM
Hmm, I think it's probably an oversight that we didn't include that alias for XHTML.  I'll open a bug so that gets added.

I can't provide the alias in a hotfix, but you can add it to XHTML in a few steps.

1) With a XHTML file open, go to Document -> XHTML Options, and select the "Aliases" page.
2) Click on the '+' to add a new alias.  Name the alias "tag", and check the box that says "Surround with".
3) For the body of the alias, copy in this:

Code: [Select]
<%(tag)%\c>
%\m sur_text -indent%
</%(tag)>

4) In the bottom "Parameters" list box, click the "+" to add a parameter, and name it "tag", and make the prompt something like "Tag name".

5) Hit Ok on the options dialog.  It should work as the XML surround-with tag does.