#53 Strange escapes when using single quotes

defect
closed-fixed
formatter (18)
5
2002-02-10
2002-01-30
No

I'm a little confused. When I put double-quotes and
less-than and greater-than symbols in my doc strings,
it usually looks fine in the output (the source HTML
shows the proper escapes). However, when I have
double-quotes and such within a single-quoted example
section, they're getting some extra escaping done,
which causes the output to look garbled.

For example, if my doc string says:

"""Here is an example. 'This example has "quotes".'"""

It would show up something like this:

Here is an example. <code>This example has
"quotes".</code>

When I want it to look like this:

Here is an example. <code>This example has
"quotes".</code>

(Hoping the HTML turned out ok.)

Why the extra & amp ; stuff?

Discussion

  • Jennifer Grucza

    Jennifer Grucza - 2002-01-30

    Logged In: YES
    user_id=442950

    Well, ok, none of the HTML worked (I didn't realize this
    was plain text), but hopefully you get the idea...

     
  • Doug Hellmann

    Doug Hellmann - 2002-02-03

    Logged In: YES
    user_id=34486

    Could you attach a short file with example docstrings? If you could
    provide one that does what you expect and one that does not seem to work,
    I'll see what's up.

    Doug

     
  • Jennifer Grucza

    Jennifer Grucza - 2002-02-06

    Example docstrings & output

     
  • Jennifer Grucza

    Jennifer Grucza - 2002-02-06

    Logged In: YES
    user_id=442950

    Hopefully this is more helpful. :) In the zip file are:

    1) testdoc.py - has docstrings with quotes and less
    than/greater than operators, both regularly and in examples
    (defined as being within single quotes).

    2) testdoc.py.html - what HappyDoc outputs.

    3) testdoc-corrected.py.html - what I think HappyDoc should
    output.

     
  • Doug Hellmann

    Doug Hellmann - 2002-02-10

    Logged In: YES
    user_id=34486

    I've just checked in a change to the structured text
    docstring parser
    (happydoclib/docstring/docstring_StructuredText.py) that
    should resolved this problem.

     
  • Doug Hellmann

    Doug Hellmann - 2002-02-10
    • status: open --> closed-fixed
     

Log in to post a comment.