File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class ChangelogService {
6060 */
6161 async loadTopic ( topicSlugId ) {
6262 const apiBase = await this . getApiBase ( ) ;
63- if ( topicSlugId . match ( / r m - \d + / ) ) {
63+ if ( topicSlugId . match ( / ^ r m - v \d + - . * / ) ) {
6464 const url = `${ apiBase } /changelog.json` ;
6565 const response = await fetch ( url ) ;
6666 const json = await response . json ( ) ;
Original file line number Diff line number Diff line change @@ -102,20 +102,23 @@ class ChangelogTopic {
102102
103103 /** @returns {string } */
104104 get content ( ) {
105- if ( this . data . slug . match ( / ^ r m - / ) && this . data . changelog ) {
105+ if ( this . data . slug . match ( / ^ r m - v \d + - . * / ) && this . data . changelog ) {
106106 return this . data . changelog
107- . map (
108- ( changelog ) => `
109- <div class='rmcl'>
110- <h3>${ changelog . operationId } </h3>
111- <div>
112- <span class="rmcl-http-method-tag rmcl-http-method-${ changelog . operation . toLocaleLowerCase ( ) } ">${ changelog . operation } </span>
113- <span class="rmcl-api-endpoint-url">${ changelog . path } </span>
114- </div>
115- <p>${ changelog . text . replaceAll ( / ' ( [ ^ ' ] + ) ' / g, '<span class="rmcl-inline-code">$1</span>' ) } </p>
116- </div>
117- ` ,
118- )
107+ . map ( ( changelog ) => {
108+ if ( changelog . operationId ) {
109+ return `<div class='rmcl'>
110+ <h3>${ changelog . operationId } </h3>
111+ <div>
112+ <span class="rmcl-http-method-tag rmcl-http-method-${ changelog . operation . toLocaleLowerCase ( ) } ">${ changelog . operation } </span>
113+ <span class="rmcl-api-endpoint-url">${ changelog . path } </span>
114+ </div>
115+ <p>${ changelog . text . replaceAll ( / ' ( [ ^ ' ] + ) ' / g, '<span class="rmcl-inline-code">$1</span>' ) } </p>
116+ </div>` ;
117+ }
118+ return `<div class='rmcl'>
119+ <p>${ changelog . text . replaceAll ( / ' ( [ ^ ' ] + ) ' / g, '<span class="rmcl-inline-code">$1</span>' ) } </p>
120+ </div>` ;
121+ } )
119122 . join ( '' ) ;
120123 }
121124 return this . posts . length ? this . posts [ 0 ] . cooked : '' ;
You can’t perform that action at this time.
0 commit comments