File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,10 +101,7 @@ async function main () {
101101 // As a blanket rule, only update titles in links that have quotes around them.
102102 // Update: "[Foo](/foo)"
103103 // Do not update: [Bar](/bar)
104- let noQuotesAroundLink
105- if ( ! newContent . includes ( `"${ oldMarkdownLink } ` ) ) {
106- noQuotesAroundLink = true
107- }
104+ const hasQuotesAroundLink = newContent . includes ( `"${ oldMarkdownLink } ` )
108105
109106 let foundPage , fragmentMatch , versionMatch
110107
@@ -142,7 +139,7 @@ async function main () {
142139 // If the original link includes a fragment or the original title includes Liquid, do not change;
143140 // otherwise, use the found page title. (We don't want to update the title if a fragment is found because
144141 // the title likely points to the fragment section header, not the page title.)
145- const newTitle = fragmentMatch || oldTitle . includes ( '{%' ) || noQuotesAroundLink ? oldTitle : foundPage . title
142+ const newTitle = fragmentMatch || oldTitle . includes ( '{%' ) || ! hasQuotesAroundLink ? oldTitle : foundPage . title
146143
147144 // If the original link includes a fragment, append it to the found page path.
148145 // Also remove the language code because Markdown links don't include language codes.
You can’t perform that action at this time.
0 commit comments