-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add markup delimiters supported by Xcode #654
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR! To update fixtures, you can set the OVERWRITE_FIXTURES or APPEND_FIXTURES environment variables while running the tests. |
// .replacingOccurrences(of: "<strong>", with: "**") | ||
// .replacingOccurrences(of: "</strong>", with: "**") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out by mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't have tests, will probably remove from this PR, or add tests.
import SourceKittenFramework | ||
import XCTest | ||
|
||
let markupDelmitersXML = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be a file in the Fixtures/
directory instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure how fixtures are set up, but sounds like a good idea.
@jpsim @norio-nomura I'm going to need some help getting these fixtures fixed for all Swift versions supported. Any suggestions? |
Summary
This PR adds support for documentation markup delimiters supported by Xcode (see full list of markup delimiters).
Code changes
parseFullXMLDocs
method inFile.swift
to extractAbstract
,ThrowsDiscussion
and other supported delimiters from XML documentparseFullXMLDocs
to support emphasis by replacing<emphasis>
with_
SwiftDocKey
enumSwiftDocMarkupDelimiterTests
to test each supported delimiterNote: Some fixtures are pending to be updated, will fix soon. Any help by maintainers would be appreciated.