diff options
author | Yu-Jie Lin <livibetter@gmail.com> | 2013-09-21 05:46:54 +0800 |
---|---|---|
committer | Yu-Jie Lin <livibetter@gmail.com> | 2013-09-21 05:46:54 +0800 |
commit | 19f495a9a4cb04d2c16a1b8b33dbcdf01f952947 (patch) | |
tree | f99c66f0d1a09d6166f681715c734a0ece51cb4f /docs | |
parent | 1daf463ae09e3db7cb960775087f21ff5ce25dc6 (diff) | |
download | smartypants-19f495a9a4cb04d2c16a1b8b33dbcdf01f952947.tar.gz |
add doc for skipped HTML comments
Diffstat (limited to 'docs')
-rw-r--r-- | docs/usage.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/usage.rst b/docs/usage.rst index 560cdf0..954edd2 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -44,6 +44,9 @@ To use these attributes, simply using bitwise *OR* operator, that is ``A | B``: Skipped HTML elements ===================== +Elements +-------- + By default, there are a few HTML elements that :func:`smartypants.smartypants` do not try to be smart with them: @@ -68,6 +71,28 @@ being used by :func:`smartypants.smartypants`. You could actually overwrite expression. +Comments +-------- + +HTML comments are always skipped since they are not rendered in browsers. + +.. code:: python + + >>> from smartypants import smartypants as sp + >>> print(sp('<!-- <span>"foobar"</span> -->')) + <!-- <span>"foobar"</span> --> + +.. important:: + + Beware of ``--``, which should not or must not be in a HTML comment. + + .. code:: python + + >>> from smartypants import smartypants as sp + >>> print(sp('<!-- <span>"foo--bar"</span> -->')) + <!— <span>”foo—bar”</span> —> + + Backslash escapes ================= |