Tapatalk

How to automatically apply HTML tags to selected text

How to automatically apply HTML tags to selected text

1
NewbieNewbie
1

    Jan 18, 2013#1

    This seems like such a basic question, but after searching around in the help and on the website, I did not see an answer. When I paste text into a document, highlight the text and then click my desired tag, I would expect the text to automatically be enclosed within the desired tag. Instead the default behavior puts the entire tag before my text and then requires me to cut and paste the text between the opening and closing tags, which is much more time consuming. 

    Is there an option to enable the desired behavior? Thanks, John.

    6,685587
    Grand MasterGrand Master
    6,685587

      Jan 19, 2013#2

      Do you mean with highlight text that you select the text?

      Highlighting means only displaying a text with a different color. No action can be applied on just highlighted text. Selecting a text marks a string for manipulation.


      And what do you mean with click my desired tag?

      In View - Views/Lists - Tag List there is the tag group HTML - Tags which can be selected at top of the view. Double clicking on a tag in this view results in inserting the start and end tag around the selected text. The tags can be customized and tag groups can be removed or added by right clicking into the tag list view and clicking on Modify Tags.


      Next there is the HTML Toolbar with 27 predefined and 23 custom tags. Most of the 27 predefined tags can be customized too. Those tags are usually also inserted around a selected text. Some special coded HTML toolbar commands can't be customized at Advanced - Configuration - Toolbars / Menus - HTML Toolbar. Some HTML toolbar commands can even convert a selected block to a HTML block as the 2 commands for a bulleted or a numbered list.

      Note: The HTML Toolbar introduced with UltraEdit for Windows v11.00 is not available anymore nearly completely customizable in UE for Windows v23.xx.


      Last you may reference (smart) templates which you have created by yourself. You can define such templates also for inserting text around a selection. After opening Modify Templates via context menu (right click) of Template List view or Advanced - Display/Modify Templates press key F1 or click on button Help. The first table on the help page lists special text strings. Most likely you are interested in [$replace$].

      For example <a href="mailto:^">[$replace$]</a> can be used to insert a mailto link around a selected text and setting caret to the position for inserting the email address.

      With smart templates introduced with UE for Windows v18.00 above template can be also coded as <a href="mailto:[+address+]">[$replace$]</a> which is even better as the caret is after inserting the template and typing the email address after the end tag.

      But the template can be even more improved by using <a href="mailto:[+address+]">[+[$replace$]+]</a> for the template. When inserting this template, the email address must be entered and replaces address. If a string is selected on inserting the template, the selected text is the default for the second parameter which in this case must not be modified. But if nothing is selected on inserting the template, the second parameter has no name and therefore no default string, but the visible string for the mailto link can be nevertheless entered like a parameter as the email address. And the caret is finally after inserting the template always after the end tag.

      Extra hint: It is possible to assign a custom hotkey or chord (multi-key assignment) to first 50 global templates for quick inserting the associated template by key.