Skip to content

Commit 02419a3

Browse files
feat(markdown-converter): use semantic html with classes
1 parent 22b4ffc commit 02419a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/utilities/src/utilities/markdownToHtml/markdownToHtml.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const _fixDoubleSpaces = str => str.replace(_doubleSpaceRegex, ' ');
3535
* @param {object} options Object with options for the conversion
3636
* @param {boolean} options.italic Defines if should convert italic
3737
* @param {boolean} options.bold Defines if should convert bold
38-
* @param {boolean} options.useCarbonClasses If true uses carbon type classes otherwise uses sematic html tags.
38+
* @param {boolean} options.useCarbonClasses If true uses carbon typography classes
3939
* @returns {string} String converted to html
4040
* @example
4141
* import { markdownToHtml } from '@carbon/ibmdotcom-utilities';
@@ -53,14 +53,14 @@ function markdownToHtml(str, { italic, bold, useCarbonClasses } = {}) {
5353
return match;
5454
}
5555
return useCarbonClasses
56-
? `<span class="${prefix}--type-light">${p1}</span>`
56+
? `<em class="${prefix}--type-light">${p1}</em>`
5757
: `<em>${p1}</em>`;
5858
});
5959
}
6060
if (bold || isAllStyles) {
6161
converted = converted.replace(_boldRegex, (match, p1) => {
6262
return useCarbonClasses
63-
? `<span class="${prefix}--type-semibold">${p1}</span>`
63+
? `<strong class="${prefix}--type-semibold">${p1}</strong>`
6464
: `<strong>${p1}</strong>`;
6565
});
6666
}

0 commit comments

Comments
 (0)