2020-07-15 13:52:35 +01:00
|
|
|
import { observes, on } from "discourse-common/utils/decorators";
|
2019-10-23 12:30:52 -04:00
|
|
|
import Component from "@ember/component";
|
2020-07-15 13:52:35 +01:00
|
|
|
import highlightSyntax from "discourse/lib/highlight-syntax";
|
2015-08-20 13:43:12 -04:00
|
|
|
|
2023-02-23 15:32:53 +00:00
|
|
|
export default class HighlightedCode extends Component {
|
2020-07-15 13:52:35 +01:00
|
|
|
@on("didInsertElement")
|
|
|
|
@observes("code")
|
2020-08-17 15:44:39 -04:00
|
|
|
_refresh() {
|
2020-09-01 09:50:49 +02:00
|
|
|
highlightSyntax(this.element, this.siteSettings, this.session);
|
2023-02-23 15:32:53 +00:00
|
|
|
}
|
|
|
|
}
|