-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update ineff regex #357 #410
Conversation
90b4ec4
to
a7e1841
Compare
template/scripts/generateDocs.js
Outdated
@@ -59,7 +59,7 @@ function formatTemplateFileContents(content, destination) { | |||
result = result.replace(/>(\r\n|\r|\n){2,}/g, '>\r\n'); // Remove empty lines directly after a closing html tag. | |||
result = result.replace(/>(\r\n|\r|\n)```/g, '>\r\n\r\n```'); // Ensure an empty line before code samples. | |||
result = result.replace(/>(\r\n|\r|\n){2,}```(\r\n|\r|\n)/g, '>\r\n```\r\n'); // Ensure no empty lines before close of code sample. | |||
result = result.replace(/([^(\r\n|\r|\n)])(\r\n|\r|\n)+#/g, "$1\r\n\r\n#"); // Ensure empty line before header sections. | |||
result = result.replace(/([^\r\n])([\r\n|\r|\n]+)/g, "$1\r\n\r\n#"); // Ensure empty line before header sections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regex will malform the output of HTML from the markdown docs.
a7e1841
to
5108ace
Compare
5108ace
to
a7f7ef0
Compare
fs.readFile('./demo/apiExamples.md', 'utf8', function(err, data) { | ||
formatTemplateFileContents(data, './demo/apiExamples.md'); | ||
fs.readFile('./demo/api.md', 'utf8', function(err, data) { | ||
formatTemplateFileContents(data, './demo/api.md'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the following error traced back to this update
./index.js → dist/...
created dist/ in 266ms
/Users/dalesande/src/auro/test-element/scripts/generateDocs.js:49
result = result.replace(/\[npm]/g, nameExtractionData.npm);
^
TypeError: Cannot read properties of undefined (reading 'replace')
at formatTemplateFileContents (/Users/dalesande/src/auro/test-element/scripts/generateDocs.js:49:19)
at ReadFileContext.callback (/Users/dalesande/src/auro/test-element/scripts/generateDocs.js:87:5)
at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:325:13)
Node.js v18.15.0
ERROR: "build:docs" exited with 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what repo/branch did you see this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generated a new repo using npm run build:test
Alaska Airlines Pull Request
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes: #357
Summary:
Please summarize the scope of the changes you have submitted, what the intent of the work is and anything that describes the before/after state of the project.
Type of change:
Please delete options that are not relevant.
Checklist:
By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.
Thank you for your submission!
-- Auro Design System Team