SourceForge has been redesigned. Learn more.
Close

#99 Patch to support all kinds of quotes in inline markup

closed-accepted
nobody
None
5
2008-08-23
2008-06-15
No

The attached patch allows the ReST parser to correctly handle typographic (sigle, double and angled) quotes in inline markup (instead of just ASCII quotes), like::

l’foobar_
l’`foobar`_
‘foobar_’
“foobar_”
«foobar_»
‘`foobar`_’
“`foobar`_”
«`foobar`_»
`«foobar»`_

l'_`foobar1`
l’_`foobar2`
'_`foobar1`'
"_`foobar2`",
‘_`foobar3`’
“_`foobar4`”
«_`foobar5`»
_`'foobar1'`
_`"foobar2"`
_`‘foobar3’`
_`“foobar4”`
_`«foobar5»`

This makes using the typographically correct quotes for several languages possible under ReST. It also adds support for working with the typographically correct apostrophe character next to a backquote, which fixes #1912594. Full unit test code is included, as well as the proper modifications to ``rst.el`` for the Emacs mode.

All existing and new unit tests pass under SVN revision 5570.

Discussion

  • Stefan Merten

    Stefan Merten - 2008-07-16

    Logged In: YES
    user_id=746432
    Originator: NO

    Modification to ``rst.el`` is included in r5597.

     
  • Ivan Vilata i Balaguer

    Logged In: YES
    user_id=1064183
    Originator: YES

    Thanks, smerten. However, the modification to the Emacs mode doesn't make much sense if the patches to ``states.py`` (and ``test_inline_markup.py``) don't get applied as well. Who does this depend on?

     
  • Stefan Merten

    Stefan Merten - 2008-07-17

    Logged In: YES
    user_id=746432
    Originator: NO

    That's true and I thought about it. Unfortunately there is no good automatic solution because rst.el can't know whether the patch is in or not.

    Would you recommend removing it again until the patch is included in the parsers?

     
  • Ivan Vilata i Balaguer

    Logged In: YES
    user_id=1064183
    Originator: YES

    Well, I think the most consistent option would be to patch the parsers and the Emacs file at the same time to avoid working on differing syntaxes. However, seeing how #1912594 was ignored, I think that the people responsible on parsing don't know this patch. Do you think I should ask on the development list?

     
  • engelbert gruber

    Logged In: YES
    user_id=147070
    Originator: NO

    Applied the patch.
    Excluding emacs mode rst.el, which already contains similar code.

     
  • engelbert gruber

    • status: open --> closed-accepted
     

Log in to post a comment.