Skip to content

Commit 8475ea7

Browse files
committed
Chore: Add comment
1 parent 3fd9ee6 commit 8475ea7

File tree

1 file changed

+2
-0
lines changed
  • packages/components/src/components/hds/code-block

1 file changed

+2
-0
lines changed

packages/components/src/components/hds/code-block/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ export default class HdsCodeBlock extends Component<HdsCodeBlockSignature> {
261261
this._isExpanded = !this._isExpanded;
262262
}
263263

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
264266
private _addHighlightSrOnlyText(code: string): SafeString {
265267
const NEW_LINE_EXP = /\n(?!$)/g;
266268
const lines = code.split(NEW_LINE_EXP);

0 commit comments

Comments
 (0)