[TEST ONLY - DO NOT MERGE] feat(replace-quotes.js): updating the script #124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[This pull request is for testing purposes only and should not be merged]
This pull request updates the
replace-quotes.js
script to handle additional edge cases related totitle
fields in Markdown files. It also includes a list of test.md
files in thedocs/pt/announcements
directory to validate the script's functionality.Changes Made
1. Enhancements to
replace-quotes.js
Improve the script to handle additional edge cases for
title
fields in Markdown files.help-center-content\docs-utils\replace-quotes.js
Handle empty or whitespace-only titles:
title:
empty fields or containing only spaces.Fix unquoted titles:
title
fields.title: Hello world
totitle: "Hello world"
Fix double-quoted titles:
title: "Hello "world""
totitle: 'Hello "world"'
Fix single-quoted titles with nested single quotes:
title: 'Hello 'world''
totitle: "Hello 'world'"
Handle mixed quotes:
title: "Hello 'world'"
remainstitle: "Hello 'world'"
Handle escaped quotes:
\"
) and logs them without modifying them.title: "Hello \"world\""
remainstitle: "Hello \"world\""
Handle multiline titles:
title
fields and logs a warning.2. Updated
index.js
Retained the call to
replaceQuotes
while commenting out unrelated functions (fixCallouts
andupdateAllImages
) during testing.help-center-content\index.js
3. Deleted original files in the
docs
directoryreplace-quotes.js
script.4. List of test
.md
Fileshelp-center-content\docs\pt\announcements
replace-quotes.js
script against various edge cases.2025-04-02-announcement-test-apostrophe-one.md
:2025-04-02-announcement-test-com-crase-e-aspas.md
:test-empty-title.md
:title
fields.test-whitespace-title.md
:title
fields.test-unquoted-title.md
:title
fields.test-double-quoted-title.md
:title
fields with nested quotes.test-single-quoted-nested-title.md
:title
fields with nested single quotes.test-mixed-quotes.md
:title
fields.test-escaped-quotes.md
:title
fields.test-special-characters.md
:title
fields.title: "Hello @#$%^&*()"
test-multiline-title.md
:title
fields.How to test locally
1 Clone this repository
2. Checkout to the branch
EDU-13262
.3. Open a terminal and make sure you are in the following directory:
help-center-content/index.js
4. Run the following command:
.md
files in thedocs/pt/announcements
directory to confirm that thetitle
fields are formatted as expected.Next Steps
replace-quotes.js
file.docs
directory remains unchanged in the new pull request.