You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a snippet slice directive must be a line comment of the form // snippet.*. unfortunately, DocC seems to be incorrectly interpreting the contents of a multiline string literal as slice comments. for example, the following snippet
// snippet.hide
import Snippets_Example
// snippet.showlet _:String="""Only this part of the code will be shown.// snippet.hideSnippet markers inside multiline string literals are ignored.// snippet.show"""
ought to display the entire multiline string literal, but instead i get this:
Checklist
If possible, I've reproduced the issue using the main branch of this package.
DocC should leave the contents of the string literal alone.
Actual behavior
DocC is interpreting comment-like substrings inside the literal as if they were actual comment tokens, and performing cuts in those locations.
this can cause serious corruption of the contents, for example:
// snippet.hide
import Snippets_Example
// snippet.show// snippet.hidelet _:String="""Only this part of the code will be shown.// snippet.showSnippet markers inside multiline string literals are ignored."""
will produce unbalanced string literal delimiters.
Steps To Reproduce
No response
Swift-DocC Version Information
Plugin version 1.3.0
Swift Compiler Version Information
Swift version 5.10 (swift-5.10-RELEASE)
Target: x86_64-unknown-linux-gnu
The text was updated successfully, but these errors were encountered:
tayloraswift
changed the title
Snippet slicing does not handle multiline string literals correctly.
Snippet slicing does not handle multiline string literals correctly
Jun 10, 2024
Description
a snippet slice directive must be a line comment of the form
// snippet.*
. unfortunately, DocC seems to be incorrectly interpreting the contents of a multiline string literal as slice comments. for example, the following snippetought to display the entire multiline string literal, but instead i get this:
Checklist
main
branch of this package.Expected Behavior
DocC should leave the contents of the string literal alone.
Actual behavior
DocC is interpreting comment-like substrings inside the literal as if they were actual comment tokens, and performing cuts in those locations.
this can cause serious corruption of the contents, for example:
will produce unbalanced string literal delimiters.
Steps To Reproduce
No response
Swift-DocC Version Information
Plugin version 1.3.0
Swift Compiler Version Information
The text was updated successfully, but these errors were encountered: