molivier / nest

Nest Pelican Template
https://www.molivier.com
GNU General Public License v2.0
123 stars 50 forks source link

Safe description in article and page #2

Closed samdolt closed 9 years ago

samdolt commented 9 years ago

Html code and " in an article or a page can break the site.

Before:

<!DOCTYPE html>
<html lang="fr">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="Bienvenue sur mon nouveau blog. def hello_world(self): """ <html> <body> <h1>Hello, World!</h1> <body> </html> """ return __doc__">
        <meta name="keywords" content="">
        <link rel="icon" href="/favicon.ico">

After:

<!DOCTYPE html>
<html lang="fr">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="Bienvenue sur mon nouveau blog. def hello_world(self): &#34;&#34;&#34; &lt;html&gt; &lt;body&gt; &lt;h1&gt;Hello, World!&lt;/h1&gt; &lt;body&gt; &lt;/html&gt; &#34;&#34;&#34; return __doc__">
        <meta name="keywords" content="">
        <link rel="icon" href="/favicon.ico">