Home > Software engineering >  how to highlight XML tags in text-area writer
how to highlight XML tags in text-area writer

Time:11-30

<div >
<div >
<label >
<?php echo trans('site_key'); ?></label>
<textarea name="create-xml-header" id="create-xml-header" rows="1" cols="100"> </textarea>
</div>          
</div>

output: output text area

how to highlight XML tags in this text-area writer ?

CodePudding user response:

You can use a syntax highlighting library or plugin to highlight XML tags in a text-area writer. One popular library is CodeMirror. You can find multiple examples of how to use CodeMirror with XML on the official website.

For example, you can use the following code to enable XML syntax highlighting in your text-area writer:

<script>
  var editor = CodeMirror.fromTextArea(document.getElementById("create-xml-header"), {
    mode: "xml"
  });
</script>
  • Related