Jump to content

XML in plaintext, what to do with it?

Recommended Posts

I want to extend XHTML with tags like

<pre syntax:format="python">
# Some Python code
def f():

The text in <pre> tag should be "enriched" with <span> HTML tags with classes, to highlight the syntax of the text inside <pre>.

What my code should do if the processed <pre> tag already contains some XML tags? Example:

<pre syntax:format="python">
# Some Python code
def f():

The variants I thought of:

  1. first remove the tags (like <em> in the above example)
  2. leave the content of the <pre> tag as is (just remove syntax:format argument)
  3. terminate my pipeline processing with an error
Edited by porton
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...