Skip to main content
Participating Frequently
June 8, 2019
Answered

Escaping Chunks of HTML (and other code)

  • June 8, 2019
  • 1 reply
  • 237 views

Hi,

I'm blogging and inserting snippets of code (HTML, JavaScript, Java).  This code usually includes angle brackets, <>.

Is there a plugin, macro, or other technique that will let me highlight a chunk of code and replace the < with &lt; and > with &gt;?  Right now, I'm doing a search and replace in Sublime text and pasting the result.  I didn't see a Find and Replace in Selection in DW.

Thanks,

Carl

This topic has been closed for replies.
Correct answer Nancy OShea

Copy code and paste into DW Design view.  The resulting code will contain the HTML entities you want.

Another option is to use CodePen or JS Fiddle to embed code directly into your blog post.  See CSS Tricks for an example.

https://css-tricks.com/snippets/css/stack-of-paper/

1 reply

Nancy OShea
Community Expert
Nancy OSheaCommunity ExpertCorrect answer
Community Expert
June 8, 2019

Copy code and paste into DW Design view.  The resulting code will contain the HTML entities you want.

Another option is to use CodePen or JS Fiddle to embed code directly into your blog post.  See CSS Tricks for an example.

https://css-tricks.com/snippets/css/stack-of-paper/

Nancy O'Shea— Product User & Community Expert