We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fd9ee6 commit 8475ea7Copy full SHA for 8475ea7
packages/components/src/components/hds/code-block/index.ts
@@ -261,6 +261,8 @@ export default class HdsCodeBlock extends Component<HdsCodeBlockSignature> {
261
this._isExpanded = !this._isExpanded;
262
}
263
264
+ // Logic for determining where line highlighting starts and ends taken from Prism.js plugin source code
265
+ // Context: https://github.com/PrismJS/prism/blob/19f8de66b0f3a79aedbbf096081a4060fc0e80af/src/plugins/line-highlight/prism-line-highlight.ts#L82
266
private _addHighlightSrOnlyText(code: string): SafeString {
267
const NEW_LINE_EXP = /\n(?!$)/g;
268
const lines = code.split(NEW_LINE_EXP);
0 commit comments