-
Notifications
You must be signed in to change notification settings - Fork 554
refactor(api-markdown-documenter): Remove support for unsafe escaped text support from PlainTextNode
#24786
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
refactor(api-markdown-documenter): Remove support for unsafe escaped text support from PlainTextNode
#24786
Conversation
…n into its own type
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.
Pull Request Overview
Refactors how escaped text is handled by extracting it into its own EscapedTextNode
type, removes the escaped
flag from PlainTextNode
, and updates renderers, transformations, and tests accordingly.
- Introduces
EscapedTextNode
class and related mapping in domain index - Updates markdown and HTML renderers/transformers to handle escaped text separately
- Removes
escaped
parameter fromPlainTextNode
and adjusts tests
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tools/api-markdown-documenter/src/renderers/markdown-renderer/test/RenderDocument.test.ts | Adds test for escaped markdown rendering |
tools/api-markdown-documenter/src/renderers/markdown-renderer/default-renderers/RenderPlainText.ts | Removes node.escaped branch and refactors whitespace splitter export |
tools/api-markdown-documenter/src/renderers/markdown-renderer/default-renderers/RenderEscapedText.ts | Implements renderer for EscapedTextNode |
tools/api-markdown-documenter/src/renderers/markdown-renderer/default-renderers/index.ts | Exports and registers renderEscapedText |
tools/api-markdown-documenter/src/documentation-domain/PlainTextNode.ts | Drops escaped flag from PlainTextNode constructor |
tools/api-markdown-documenter/src/documentation-domain/EscapedTextNode.ts | Adds new EscapedTextNode class |
tools/api-markdown-documenter/src/documentation-domain-to-html/default-transformations/EscapedTextToHtml.ts | Implements HTML transformer for EscapedTextNode |
tools/api-markdown-documenter/src/api-item-transforms/TsdocNodeTransforms.ts | Emits EscapedTextNode from TSDoc escapes |
tools/api-markdown-documenter/api-report/**/* | Updates public API to include EscapedTextNode and remove escaped param |
Comments suppressed due to low confidence (4)
tools/api-markdown-documenter/src/renderers/markdown-renderer/default-renderers/index.ts:85
- The renderer key is a raw property
escapedText
. For consistency with other renderers, use[DocumentationNodeType.EscapedText]
as the key so it maps correctly to the node type.
escapedText: (node, writer, context): void =>
tools/api-markdown-documenter/src/documentation-domain-to-html/default-transformations/EscapedTextToHtml.ts:18
- The doc comment refers to
PlainTextNode
but this function handlesEscapedTextNode
. Update the reference to{@link EscapedTextNode}
.
* Transform a {@link PlainTextNode} to HTML.
tools/api-markdown-documenter/src/renderers/markdown-renderer/test/RenderDocument.test.ts:64
- The test references
SectionNode
but it is not imported at the top. AddSectionNode
to the import list to prevent missing-symbol errors.
new SectionNode([
tools/api-markdown-documenter/src/documentation-domain-to-html/configuration/Transformation.ts:94
- The transformation key uses a raw property
escapedText
. To ensure the escaped node is picked up, use[DocumentationNodeType.EscapedText]
instead of an unscoped property.
escapedText: (node, context) => escapedTextToHtml(node as EscapedTextNode, context),
tools/api-markdown-documenter/src/documentation-domain/EscapedTextNode.ts
Outdated
Show resolved
Hide resolved
…com/Josmithr/FluidFramework into api-markdown-documenter/EscapedText
...i-markdown-documenter/src/renderers/markdown-renderer/default-renderers/RenderEscapedText.ts
Outdated
Show resolved
Hide resolved
PlainTextNode
...api-markdown-documenter/src/renderers/markdown-renderer/default-renderers/RenderPlainText.ts
Outdated
Show resolved
Hide resolved
...api-markdown-documenter/src/renderers/markdown-renderer/default-renderers/RenderPlainText.ts
Outdated
Show resolved
Hide resolved
@@ -78,7 +78,6 @@ | |||
"chalk": "^4.1.2", | |||
"hast-util-format": "^1.1.0", | |||
"hast-util-from-html": "^2.0.3", | |||
"hast-util-raw": "^9.0.2", |
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.
No longer needed!
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
This type previously supported an unsafe escape hatch for text escaping.
This support is no longer needed and has been removed.