technomancy / slamhound

Slamhound rips your namespace form apart and reconstructs it.
Other
473 stars 38 forks source link

Fix multiline docstrings #49

Closed guns closed 11 years ago

guns commented 11 years ago

(I screwed up multiline docstrings. Sorry! I don't usually write ns docstrings, and the tests didn't cover this case. This patch should correct all of this.)

Commit e66a40683e2ebf94a1e3bea53706c55ab879c7cd fixed unintentional unescaping of docstrings, but also broke multiline docstrings:

    (ns example
      "Foo
       Bar
       Baz")

    =>

    (ns example
      "Foo\n   Bar\n   Baz")

This approach manually escapes \ and " inside of docstrings, but leaves newlines and other characters as is so that the string is reprinted as intended.

technomancy commented 11 years ago

Nice catch; thanks!