File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
apps/api-documenter/src/yaml Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -88,9 +88,21 @@ export class OfficeYamlDocumenter extends YamlDocumenter {
8888
8989 if ( yamlItem . summary ) {
9090 yamlItem . summary = this . _fixupApiSet ( yamlItem . summary , yamlItem . uid ) ;
91+ yamlItem . summary = this . _fixBoldAndItalics ( yamlItem . summary ) ;
92+ yamlItem . summary = this . _fixCodeTicks ( yamlItem . summary ) ;
9193 }
9294 if ( yamlItem . remarks ) {
9395 yamlItem . remarks = this . _fixupApiSet ( yamlItem . remarks , yamlItem . uid ) ;
96+ yamlItem . remarks = this . _fixBoldAndItalics ( yamlItem . remarks ) ;
97+ yamlItem . remarks = this . _fixCodeTicks ( yamlItem . remarks ) ;
98+ }
99+ if ( yamlItem . syntax && yamlItem . syntax . parameters ) {
100+ yamlItem . syntax . parameters . forEach ( part => {
101+ if ( part . description ) {
102+ part . description = this . _fixCodeTicks ( part . description ) ;
103+ part . description = this . _fixBoldAndItalics ( part . description ) ;
104+ }
105+ } ) ;
94106 }
95107 }
96108
@@ -115,4 +127,19 @@ export class OfficeYamlDocumenter extends YamlDocumenter {
115127 return this . _apiSetUrlDefault ; // match not found.
116128 }
117129
118- }
130+ private _fixBoldAndItalics ( text : string ) : string {
131+ while ( text . indexOf ( '\\*' ) >= 0 ) {
132+ text = text . replace ( '\\*' , '*' ) ;
133+ }
134+
135+ return text ;
136+ }
137+
138+ private _fixCodeTicks ( text : string ) : string {
139+ while ( text . indexOf ( '\\`' ) >= 0 ) {
140+ text = text . replace ( '\\`' , '`' ) ;
141+ }
142+
143+ return text ;
144+ }
145+ }
You can’t perform that action at this time.
0 commit comments