noahmorrison / chevron

A Python implementation of mustache
MIT License
505 stars 55 forks source link

HTML tags problem #98

Closed nclsbayona closed 3 years ago

nclsbayona commented 3 years ago

I create this issue because I'm facing a problem when trying to generate an HTML table from python. I'm using the prettytable module, specifically get_html_string() method, and I see that maybe the render function needs a way of just replacing the text with the plain text. I think that this can be accomplished by adding a parameter for the coding options. In python I get the following table

<table>        <thead>            <tr>                <th>OS name</th>                <th>Time spent</th>            </tr>        </thead>        <tbody>            <tr>                <td>Linux</td>                <td>37 hours and 57 minutes</td>            </tr>        </tbody>    </table>

However, in HTML it looks like this

&lt;table&gt;        &lt;thead&gt;            &lt;tr&gt;                &lt;th&gt;OS name&lt;/th&gt;                &lt;th&gt;Time spent&lt;/th&gt;            &lt;/tr&gt;        &lt;/thead&gt;        &lt;tbody&gt;            &lt;tr&gt;                &lt;td&gt;Linux&lt;/td&gt;                &lt;td&gt;37 hours and 57 minutes&lt;/td&gt;            &lt;/tr&gt;        &lt;/tbody&gt;    &lt;/table&gt;
jscaria commented 3 years ago

Take a look at https://stackoverflow.com/a/15262481.

nclsbayona commented 3 years ago

Ok. Thanks

nclsbayona commented 3 years ago

Thanks a lot @jscaria , we can close this now