diff --git a/js/src/forum/components/Poll/PollListItem.tsx b/js/src/forum/components/Poll/PollListItem.tsx index eebf2aaa..972d2b20 100644 --- a/js/src/forum/components/Poll/PollListItem.tsx +++ b/js/src/forum/components/Poll/PollListItem.tsx @@ -115,21 +115,26 @@ export default class PollListItem -

{highlight(this.poll.question(), this.highlightRegExp)}

- {this.poll.subtitle() &&

{this.poll.subtitle()}

} +

{highlight(this.pollQuestion(this.poll), this.highlightRegExp)}

+ {this.poll.subtitle() &&

{this.pollSubtitle(this.poll)}

} ); } - // infoView() { - // return ( - //
- // {this.poll.subtitle() &&

{this.poll.subtitle()}

} - // - //
- // ); - // } + /** + * Allow extensions to revise the question string. + */ + pollQuestion(poll: Poll): string { + return poll.question(); + } + + /** + * Allow extensions to revise the subtitle string. + */ + pollSubtitle(poll: Poll): string | null { + return poll.subtitle(); + } oncreate(vnode: Mithril.VnodeDOM) { super.oncreate(vnode); diff --git a/js/src/forum/components/index.ts b/js/src/forum/components/index.ts index 1653d505..20534bee 100644 --- a/js/src/forum/components/index.ts +++ b/js/src/forum/components/index.ts @@ -18,6 +18,8 @@ import { AbstractPollPage } from './AbstractPollPage'; import PollTitle from './Poll/PollTitle'; import PollSubtitle from './Poll/PollSubtitle'; import PollImage from './Poll/PollImage'; +import PollListItem from './Poll/PollListItem'; +import PollList from './Poll/PollList'; export const components = { CreatePollModal, @@ -40,4 +42,6 @@ export const components = { PollTitle, PollSubtitle, PollImage, + PollListItem, + PollList, };