remove unused class TextHighlighter
This commit is contained in:
parent
656a815991
commit
6c39213116
1 changed files with 0 additions and 26 deletions
|
@ -339,32 +339,6 @@ class HtmlHighlighter extends BaseHighlighter<string> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
class TextHighlighter extends BaseHighlighter<React.ReactNode> {
|
|
||||||
private key = 0;
|
|
||||||
|
|
||||||
/* create a <span> node to hold the given content
|
|
||||||
*
|
|
||||||
* snippet: content of the span
|
|
||||||
* highlight: true to highlight as a search match
|
|
||||||
*
|
|
||||||
* returns a React node
|
|
||||||
*/
|
|
||||||
protected processSnippet(snippet: string, highlight: boolean): React.ReactNode {
|
|
||||||
const key = this.key++;
|
|
||||||
|
|
||||||
let node = <span key={key} className={highlight ? this.highlightClass : null}>
|
|
||||||
{ snippet }
|
|
||||||
</span>;
|
|
||||||
|
|
||||||
if (highlight && this.highlightLink) {
|
|
||||||
node = <a key={key} href={this.highlightLink}>{ node }</a>;
|
|
||||||
}
|
|
||||||
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IContent {
|
interface IContent {
|
||||||
format?: string;
|
format?: string;
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
|
|
Loading…
Reference in a new issue