Search code examples
markdown

markdown - how do I display HTML?


I am trying to add a wiki page on GitHub that contains sample HTML but can't figure out how to display the actual HTML, not try to render it.

I tried & lt; & gt; and < < but then it renders it like

& lt;table& gt;


Solution

  • If you want display HTML as code sample. You can use formatting for code

    Examples:

    ```html
    <!DOCTYPE html>
    <html>
      <head>
        <title>This is a title</title>
      </head>
      <body>
        <p>Hello world!</p>
      </body>
    </html>
    ```
    
    ```xml
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    </xs:schema>
    ```