@graphql-markdown/utils
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -96,2 +96,4 @@ /** | ||
* Returns a string with MDX special characters converted to HTML unicode using {@link toHTMLUnicode}. | ||
* Characters within code notation should not be converted. | ||
* List of special characters: `{`, `<`, `>`, `}` | ||
* | ||
@@ -110,2 +112,5 @@ * @internal | ||
* // Expected result: "{MDX} <special> characters" | ||
* | ||
* escapeMDX("`{MDX}` `<special>` characters"); | ||
* // Expected result: "`{MDX}` `<special>` characters" | ||
* ``` | ||
@@ -112,0 +117,0 @@ * |
@@ -147,2 +147,4 @@ "use strict"; | ||
* Returns a string with MDX special characters converted to HTML unicode using {@link toHTMLUnicode}. | ||
* Characters within code notation should not be converted. | ||
* List of special characters: `{`, `<`, `>`, `}` | ||
* | ||
@@ -161,2 +163,5 @@ * @internal | ||
* // Expected result: "{MDX} <special> characters" | ||
* | ||
* escapeMDX("`{MDX}` `<special>` characters"); | ||
* // Expected result: "`{MDX}` `<special>` characters" | ||
* ``` | ||
@@ -166,3 +171,3 @@ * | ||
const escapeMDX = (str) => { | ||
return `${String(str)}`.replace(/[<>{}]/g, exports.toHTMLUnicode); | ||
return `${String(str)}`.replace(/(?<!`)([{<>}])(?=(?:[^`]*`[^`]*`)*[^`]*$)/g, exports.toHTMLUnicode); | ||
}; | ||
@@ -169,0 +174,0 @@ exports.escapeMDX = escapeMDX; |
{ | ||
"name": "@graphql-markdown/utils", | ||
"homepage": "https://graphql-markdown.github.io", | ||
"homepage": "https://graphql-markdown.dev", | ||
"description": "GraphQL-Markdown common libraries.", | ||
@@ -8,3 +8,3 @@ "bugs": { | ||
}, | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"license": "MIT", | ||
@@ -60,3 +60,3 @@ "repository": { | ||
"devDependencies": { | ||
"@graphql-markdown/types": "^1.2.0" | ||
"@graphql-markdown/types": "^1.3.1" | ||
}, | ||
@@ -63,0 +63,0 @@ "peerDependencies": { |
# @graphql-markdown/utils | ||
[![Latest Version](https://img.shields.io/npm/v/@graphql-markdown/utils?style=flat-square)](https://www.npmjs.com/package/@graphql-markdown/utils) | ||
[![GitHub License](https://img.shields.io/github/license/graphql-markdown/graphql-markdown?style=flat-square)](https://raw.githubusercontent.com/graphql-markdown/graphql-markdown/main/LICENSE) | ||
[![Latest Version](https://img.shields.io/npm/v/@graphql-markdown/utils?style=flat)](https://www.npmjs.com/package/@graphql-markdown/utils) | ||
[![GitHub License](https://img.shields.io/github/license/graphql-markdown/graphql-markdown?style=flat)](https://raw.githubusercontent.com/graphql-markdown/graphql-markdown/main/LICENSE) | ||
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=graphql-markdown_utils&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=graphql-markdown_utils) | ||
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=graphql-markdown_utils&metric=coverage)](https://sonarcloud.io/summary/new_code?id=graphql-markdown_utils) | ||
[![Mutation Score](https://img.shields.io/endpoint?label=mutation%20score&style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fgraphql-markdown%2Fgraphql-markdown%2Fmain%3Fmodule%3Dutils)](https://dashboard.stryker-mutator.io/reports/github.com/graphql-markdown/graphql-markdown/main?module=utils) | ||
@@ -6,0 +9,0 @@ ## Modules |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35541
1058
17