Ticket #8244: trac_8244-sagedoc.patch

File trac_8244-sagedoc.patch, 1.9 KB (added by jhpalmieri, 11 years ago)

apply on top of other patches

  • sage/misc/sagedoc.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1266618045 28800
    # Node ID c2f0b5b39d23a02406607420085ea22c3bcd3295
    # Parent  23f8091165aac046a4c57991e7c3667cec78c2d8
    trac #8244: sagedoc patch
    
    diff -r 23f8091165aa -r c2f0b5b39d23 sage/misc/sagedoc.py
    a b  
    194194
    195195    More precisely, do a regular expression search.  Replace a plain
    196196    dollar sign ($) by a backtick (`).  Replace an escaped dollar sign
    197     (\$) by a dollar sign ($).  Don't change a dollar sign preceded or
    198     followed by a backtick (`$ or $`), because of strings like
     197    (\\$) by a dollar sign ($).  Don't change a dollar sign preceded or
     198    followed by a backtick (\`$ or \$`), because of strings like
    199199    "``$HOME``".  Don't make any changes on lines starting with more
    200200    spaces than the first nonempty line in ``s``, because those are
    201201    indented and hence part of a block of code or examples.
     
    211211        sage: process_dollars('some math: $x=y$')
    212212        'some math: `x=y`'
    213213
    214     Replace \$ with $, and don't do anything when backticks are involved::
     214    Replace \\$ with $, and don't do anything when backticks are involved::
    215215
    216216        sage: process_dollars(r'a ``$REAL`` dollar sign: \$')
    217217        'a ``$REAL`` dollar sign: $'
     
    228228        sage: process_dollars(r'f(n) = 0 \text{ if $n$ is prime}')
    229229        'f(n) = 0 \\text{ if $n$ is prime}'
    230230
    231     This is not perfect:
     231    This is not perfect::
    232232
    233233        sage: process_dollars(r'$f(n) = 0 \text{ if $n$ is prime}$')
    234234        '`f(n) = 0 \\text{ if $n$ is prime}$'
     
    283283
    284284def process_mathtt(s, embedded=False):
    285285    r"""nodetex
    286     Replace \mathtt{BLAH} with either \verb|BLAH| (in the notebook) or
     286    Replace \\mathtt{BLAH} with either \\verb|BLAH| (in the notebook) or
    287287    BLAH (from the command line).
    288288
    289289    INPUT: