Skip to content

Commit c00e854

Browse files
B4nanclaude
andcommitted
fix: clean up <br /> tags and **** artifacts in .md export
- Patch llms-txt plugin to use {type:'break'} instead of raw HTML for <br> handler, producing clean \ line breaks instead of <br /> tags - Conditionally render name <strong> in SchemaItem only when present, preventing empty bold (****) for unnamed anyOf/oneOf schema options Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 62ae388 commit c00e854

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js b/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
2+
index f35c2df..4d8b9bd 100644
3+
--- a/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
4+
+++ b/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
5+
@@ -73,7 +73,7 @@ export class PluginRegistry {
6+
}
7+
// Always last - converts HTML AST to Markdown AST
8+
processor.use(rehypeRemark, {
9+
- handlers: { br: () => ({ type: 'html', value: '<br />' }) },
10+
+ handlers: { br: () => ({ type: 'break' }) },
11+
});
12+
}
13+
/**

patches/docusaurus-theme-openapi-docs+4.7.1.patch

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -802,10 +802,10 @@ index 37190c6..eddcd1e 100644
802802
}
803803
return react_1.default.createElement(SchemaItem_1.default, {
804804
diff --git a/node_modules/docusaurus-theme-openapi-docs/lib/theme/SchemaItem/index.js b/node_modules/docusaurus-theme-openapi-docs/lib/theme/SchemaItem/index.js
805-
index c1aa5d8..107ddad 100644
805+
index c1aa5d8..118822e 100644
806806
--- a/node_modules/docusaurus-theme-openapi-docs/lib/theme/SchemaItem/index.js
807807
+++ b/node_modules/docusaurus-theme-openapi-docs/lib/theme/SchemaItem/index.js
808-
@@ -136,102 +136,130 @@ function SchemaItem(props) {
808+
@@ -136,107 +136,136 @@ function SchemaItem(props) {
809809
react_1.default.createElement(Markdown_1.default, null, message)
810810
)
811811
);
@@ -871,7 +871,8 @@ index c1aa5d8..107ddad 100644
871871
react_1.default.createElement(
872872
- "code",
873873
+ "strong",
874-
+ null,
874+
null,
875+
- JSON.stringify(defaultValue)
875876
+ (0, Translate_1.translate)({
876877
+ id: translationIds_1.OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
877878
+ message: "Default value:",
@@ -881,8 +882,7 @@ index c1aa5d8..107ddad 100644
881882
+ " ",
882883
+ react_1.default.createElement(
883884
+ "span",
884-
null,
885-
- JSON.stringify(defaultValue)
885+
+ null,
886886
+ react_1.default.createElement(
887887
+ "code",
888888
+ null,
@@ -956,7 +956,8 @@ index c1aa5d8..107ddad 100644
956956
react_1.default.createElement(
957957
- "code",
958958
+ "strong",
959-
+ null,
959+
null,
960+
- JSON.stringify(constValue)
960961
+ (0, Translate_1.translate)({
961962
+ id: translationIds_1.OPENAPI_SCHEMA_ITEM.CONSTANT_VALUE,
962963
+ message: "Constant value:",
@@ -966,8 +967,7 @@ index c1aa5d8..107ddad 100644
966967
+ " ",
967968
+ react_1.default.createElement(
968969
+ "span",
969-
null,
970-
- JSON.stringify(constValue)
970+
+ null,
971971
+ react_1.default.createElement(
972972
+ "code",
973973
+ null,
@@ -987,15 +987,22 @@ index c1aa5d8..107ddad 100644
987987
null,
988988
react_1.default.createElement(
989989
"span",
990-
@@ -245,6 +273,7 @@ function SchemaItem(props) {
990+
{ className: "openapi-schema__container" },
991+
- react_1.default.createElement(
992+
+ // Apify: only render name <strong> when present to avoid **** in .md export
993+
+ name && react_1.default.createElement(
994+
"strong",
995+
{
996+
className: (0, clsx_1.default)("openapi-schema__property", {
997+
@@ -245,6 +274,7 @@ function SchemaItem(props) {
991998
},
992999
name
9931000
),
994-
+ " ", // Apify: space between name and type for .md export
1001+
+ name && " ", // Apify: space between name and type for .md export
9951002
react_1.default.createElement(
9961003
"span",
9971004
{ className: "openapi-schema__name" },
998-
@@ -254,9 +283,10 @@ function SchemaItem(props) {
1005+
@@ -254,9 +284,10 @@ function SchemaItem(props) {
9991006
react_1.default.createElement("span", {
10001007
className: "openapi-schema__divider",
10011008
}),
@@ -1009,7 +1016,7 @@ index c1aa5d8..107ddad 100644
10091016
),
10101017
renderSchemaDescription,
10111018
renderEnumDescriptions,
1012-
@@ -268,7 +298,8 @@ function SchemaItem(props) {
1019+
@@ -268,7 +299,8 @@ function SchemaItem(props) {
10131020
collapsibleSchemaContent ?? collapsibleSchemaContent
10141021
);
10151022
return react_1.default.createElement(

0 commit comments

Comments
 (0)