Skip to content
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

remove code-quote when vertical bar inside table #174

Merged

Conversation

fty4
Copy link
Contributor

@fty4 fty4 commented Aug 11, 2022

As in #168 described the quote (grave accent: `) should be removed that markdown interprets the vertical bar (|) correctly.

As in bitflight-devops#168 described the quote (grave accent: &bitflight-devops#96;)
should be removed that markdown interprets the
vertical bar (`&bitflight-devops#124;`) correctly.
@fty4
Copy link
Contributor Author

fty4 commented Aug 11, 2022

Optional:
For better visual in this README the description of the Action input owner could also be changed from

owner:
description: >
The GitHub Action repository owner. i.e: `bitflight-devops`|`your-gh-username`

to

   owner: 
     description: > 
       The GitHub Action repository owner. i.e: `bitflight-devops` or `your-gh-username` 

To ensure the markdown content is displayed as code block the escaped
section will be wrapped with HTML element `<code>`.
@fty4
Copy link
Contributor Author

fty4 commented Aug 11, 2022

Added another commit which replaces ` with HTML <code> elements to ensure representation in markdown is the same.

If this is not desired remove skip last commit 53a8f23.

@@ -45,7 +45,24 @@
const idx = i > 1 ? i - 1 : 0;
const dataRow = tableContent[idx] as string[];
for (const [j] of row.entries()) {
const content = dataRow[col]?.replace(/\|/g, '&#124;').replace(/\n/, '<br />') ?? '';
let content = dataRow[col]?.replace(/\n/, '<br />') ?? '';

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This replaces only the first occurrence of /\n/.
@Jamie-BitFlight
Copy link
Contributor

LGTM

@Jamie-BitFlight Jamie-BitFlight merged commit d7cbdb4 into bitflight-devops:main Aug 11, 2022
@fty4 fty4 deleted the fix/vertical-bar-quote branch October 26, 2022 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants