// HTML Escape Macro Code for jEdit (2011-09-22)
void escapeHTML() {
text = textArea.getSelectedText();
if(text != null){
text = text.replaceAll("&" , "&");
text = text.replaceAll("<" , "<");
text = text.replaceAll(">" , ">");
text = text.replaceAll("\"" , """);
text = text.replaceAll("'" , "'");
textArea.setSelectedText(text);
}
}
if (buffer.isReadOnly()) {
Macros.error(view, "Buffer is read-only.");
} else {
escapeHTML();
}