From 9352750cb24b672e869e7351df9875d5fa8bf7f9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 24 Mar 2012 15:53:57 -0700 Subject: RST writer: Better handling of inline formatting. * `hi*there*hi` now gets rendered properly as `hi\ *there*\ hi` * Unnecessary '\ ' are avoided around :math:, :sub:, :sup: * Implemented most of the rules in http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules, though some unnecessary '\ ' may be inserted when unicode quotes are used. --- tests/writer.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/writer.rst b/tests/writer.rst index 09fd8dcb3..8d7c7915c 100644 --- a/tests/writer.rst +++ b/tests/writer.rst @@ -563,7 +563,7 @@ This is code: ``>``, ``$``, ``\``, ``\$``, ````. [STRIKEOUT:This is *strikeout*.] -Superscripts: a\ :sup:`bc`\ d a\ :sup:`*hello*`\ a\ :sup:`hello there`\ . +Superscripts: a\ :sup:`bc`\ d a\ :sup:`*hello*` a\ :sup:`hello there`. Subscripts: H\ :sub:`2`\ O, H\ :sub:`23`\ O, H\ :sub:`many of them`\ O. @@ -602,12 +602,12 @@ LaTeX - :math:`x \in y` - :math:`\alpha \wedge \omega` - :math:`223` -- :math:`p`\ -Tree +- :math:`p`-Tree - Here’s some display math: .. math:: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} -- Here’s one that has a line break in it: :math:`\alpha + \omega \times x^2`\ . +- Here’s one that has a line break in it: :math:`\alpha + \omega \times x^2`. These shouldn’t be math: -- cgit v1.2.3