Skip to content

Handle escapes in docstrings more correctly#1228

Merged
penelopeysm merged 6 commits into
mainfrom
docstring
Jul 24, 2026
Merged

Handle escapes in docstrings more correctly#1228
penelopeysm merged 6 commits into
mainfrom
docstring

Conversation

@penelopeysm

@penelopeysm penelopeysm commented Jul 24, 2026

Copy link
Copy Markdown
Member

Closes #1224, but I'm not sure if this is enough? Particularly concerned about escaped quotes

Quotes are handled now

julia> s = raw"""
       \"""
       ```jldoctest
       julia> @macro a.\$s
       [...]
       ```
       \"""
       f
       """
"\"\"\"\n```jldoctest\njulia> @macro a.\\\$s\n[...]\n```\n\"\"\"\nf\n"

julia> ft(s; format_docstrings=true) == s
true

@github-actions

Copy link
Copy Markdown
Contributor

@penelopeysm
penelopeysm marked this pull request as ready for review July 24, 2026 13:58
@penelopeysm penelopeysm changed the title Handle escapes in docstrings correctly Handle escapes in docstrings more correctly Jul 24, 2026
@penelopeysm

Copy link
Copy Markdown
Member Author

I don't want to claim that this is perfect because I don't know if I missed something out, but it's definitely an improvement.

@penelopeysm
penelopeysm merged commit 4b1a073 into main Jul 24, 2026
16 of 18 checks passed
@penelopeysm
penelopeysm deleted the docstring branch July 24, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escape sequences in julia doctests are mangled

1 participant