@hmcts/ccd-case-ui-toolkit 7.4.26-govuk6-v2 → 7.4.26-govuk6-v3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23886,9 +23886,12 @@ class QueryCaseDetailsHeaderComponent {
|
|
|
23886
23886
|
caseFields;
|
|
23887
23887
|
ngOnInit() {
|
|
23888
23888
|
this.caseTitle = new CaseField();
|
|
23889
|
-
this.caseTitle.label = this.caseDetails?.state?.title_display;
|
|
23889
|
+
this.caseTitle.label = QueryCaseDetailsHeaderComponent.demoteHeadings(this.caseDetails?.state?.title_display);
|
|
23890
23890
|
this.caseFields = this.getCaseFieldsInfo();
|
|
23891
23891
|
}
|
|
23892
|
+
static demoteHeadings(markdown) {
|
|
23893
|
+
return typeof markdown === 'string' ? markdown.replace(/^(\s{0,3})(#{1,5})(?=\s|$)/gm, '$1$2#') : markdown;
|
|
23894
|
+
}
|
|
23892
23895
|
getCaseFieldsInfo() {
|
|
23893
23896
|
const caseDataFields = this.caseDetails?.tabs?.reduce((acc, tab) => {
|
|
23894
23897
|
return acc.concat(tab.fields);
|