markup.ml icon indicating copy to clipboard operation
markup.ml copied to clipboard

Add some possibility for custom tag ?

Open craff opened this issue 1 year ago • 5 comments

I am doing an ocaml equivalent of php (but better) for simple_httpd, and currently I use two tags:

  • <script "type="ml">...</script> accept all ocaml lexical convention but does not allow for nesting html (I would prefer not to use string or ppx).
  • <ml>...</ml> accept nesting but does not accept characters like '&'.

Altough I could live with this it is not nice.

Do you see a way to make markup extensible with some custom tags ?

Here is an example of what I use:

      <li> views: <ml>
	  let _ = echo (string_of_int count);;
	  let _ = echo (if count mod 2 = 0 then
 	                  <p>even (<ml> ^ string_of_int count ^ </ml>)</p>
	                else <p>odd</p>)
	</ml>
      </li>

Which I find nice except for the special characteres.

I would also like if my <ml> tag could occur anywhere in the document.

craff avatar Jul 14 '23 01:07 craff