Skip to content

Commit 50d9da2

Browse files
author
Anna Wen
committed
fix(markdown): jsdocs to markdown util
1 parent 680c3cf commit 50d9da2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ const _cleanString = str => str.replace(_cleanStringRegex, ' ');
4444
* @param {boolean} [options.bold=true] Defines if should convert bold
4545
* @param {boolean} [options.useCarbonClasses=true] Defines if should use carbon typography classes
4646
* @param {boolean} [options.allowHtml=false] Defines if should allow or remove html tags
47+
* @param {boolean} [options.cleanString=false] Defines if string should be cleaned of multiple spaces, html entities, or single new lines
48+
* @param {boolean} [options.createParagraphs=true] Defines if paragraphs should be rendered wrapped in <p> tags
4749
* @returns {string} String converted to html
4850
* @example
4951
* import { markdownToHtml } from '@carbon/ibmdotcom-utilities';
@@ -59,7 +61,7 @@ function markdownToHtml(
5961
useCarbonClasses = true,
6062
allowHtml = false,
6163
cleanString = false,
62-
textOnly = false,
64+
createParagraphs = true,
6365
} = {}
6466
) {
6567
let paraList = '';
@@ -90,7 +92,7 @@ function markdownToHtml(
9092
});
9193
}
9294

93-
paraList += textOnly ? para : `<p>${para}</p>`;
95+
paraList += createParagraphs ? `<p>${para}</p>` : para;
9496
});
9597

9698
return paraList;

0 commit comments

Comments
 (0)