From 164f09253bf5f2e056d94d6888d6dfab4a663901 Mon Sep 17 00:00:00 2001 From: farres1 Date: Mon, 15 Apr 2024 15:15:12 +0100 Subject: [PATCH] Add highlight to preview pages --- eq-author/src/App/history/HistoryItem.js | 14 -------------- .../Preview/IntroductionPreview/index.js | 5 ----- .../App/page/Preview/CalculatedSummaryPreview.js | 10 ++++------ .../App/page/Preview/ListCollectorPagePreview.js | 5 ----- .../AddItemPagePreview/index.js | 5 ----- .../ConfirmationPagePreview/index.js | 5 ----- .../QualifierPagePreview/index.js | 5 ----- .../src/App/page/Preview/QuestionPagePreview.js | 5 ----- .../src/App/questionConfirmation/Preview/index.js | 5 ----- .../src/App/section/Preview/SectionIntroPreview.js | 5 ----- .../src/components/preview/elements/PageTitle.js | 5 +++++ 11 files changed, 9 insertions(+), 60 deletions(-) diff --git a/eq-author/src/App/history/HistoryItem.js b/eq-author/src/App/history/HistoryItem.js index 448bb8f645..63fb59e5eb 100644 --- a/eq-author/src/App/history/HistoryItem.js +++ b/eq-author/src/App/history/HistoryItem.js @@ -69,16 +69,6 @@ const EventText = styled.div` p { margin: 0 0 1em; word-break: break-all; - em { - background-color: ${colors.highlightGreen}; - font-style: normal; - } - } - h2 { - em { - background-color: ${colors.highlightGreen}; - font-style: normal; - } } ul { margin-top: 0; @@ -89,10 +79,6 @@ const EventText = styled.div` span { font-weight: bold; } - em { - background-color: ${colors.highlightGreen}; - font-style: normal; - } } } `; diff --git a/eq-author/src/App/introduction/Preview/IntroductionPreview/index.js b/eq-author/src/App/introduction/Preview/IntroductionPreview/index.js index ca5d3e124e..948b0079d2 100644 --- a/eq-author/src/App/introduction/Preview/IntroductionPreview/index.js +++ b/eq-author/src/App/introduction/Preview/IntroductionPreview/index.js @@ -22,11 +22,6 @@ const Container = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: ${colors.highlightGreen}; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: #e0e0e0; padding: 0 0.125em; diff --git a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js index 089727839a..93bbddb0d8 100644 --- a/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js +++ b/eq-author/src/App/page/Preview/CalculatedSummaryPreview.js @@ -25,11 +25,6 @@ const Container = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: #dce5b0; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: #e0e0e0; padding: 0 0.125em; @@ -130,7 +125,10 @@ const CalculatedSummaryPagePreview = ({ page }) => { - {page.totalTitle.replace(/<\/?p>/g, "")} + { + /* Removes all HTML tags */ + page.totalTitle.replace(/<[^>]*>/g, "") + } diff --git a/eq-author/src/App/page/Preview/ListCollectorPagePreview.js b/eq-author/src/App/page/Preview/ListCollectorPagePreview.js index 54e0588e39..29af97a7fd 100644 --- a/eq-author/src/App/page/Preview/ListCollectorPagePreview.js +++ b/eq-author/src/App/page/Preview/ListCollectorPagePreview.js @@ -33,11 +33,6 @@ const Container = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: #dce5b0; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: #e0e0e0; padding: 0 0.125em; diff --git a/eq-author/src/App/page/Preview/ListCollectorPagePreviews/AddItemPagePreview/index.js b/eq-author/src/App/page/Preview/ListCollectorPagePreviews/AddItemPagePreview/index.js index 1c53a4e552..561256ae12 100644 --- a/eq-author/src/App/page/Preview/ListCollectorPagePreviews/AddItemPagePreview/index.js +++ b/eq-author/src/App/page/Preview/ListCollectorPagePreviews/AddItemPagePreview/index.js @@ -32,11 +32,6 @@ const Container = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: ${colors.highlightGreen}; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: ${colors.pipingGrey}; padding: 0 0.125em; diff --git a/eq-author/src/App/page/Preview/ListCollectorPagePreviews/ConfirmationPagePreview/index.js b/eq-author/src/App/page/Preview/ListCollectorPagePreviews/ConfirmationPagePreview/index.js index b21ea8d406..74a582950f 100644 --- a/eq-author/src/App/page/Preview/ListCollectorPagePreviews/ConfirmationPagePreview/index.js +++ b/eq-author/src/App/page/Preview/ListCollectorPagePreviews/ConfirmationPagePreview/index.js @@ -20,11 +20,6 @@ const Container = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: ${colors.highlightGreen}; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: ${colors.pipingGrey}; padding: 0 0.125em; diff --git a/eq-author/src/App/page/Preview/ListCollectorPagePreviews/QualifierPagePreview/index.js b/eq-author/src/App/page/Preview/ListCollectorPagePreviews/QualifierPagePreview/index.js index e357b302e0..6ed7a44812 100644 --- a/eq-author/src/App/page/Preview/ListCollectorPagePreviews/QualifierPagePreview/index.js +++ b/eq-author/src/App/page/Preview/ListCollectorPagePreviews/QualifierPagePreview/index.js @@ -20,11 +20,6 @@ const Container = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: ${colors.highlightGreen}; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: ${colors.pipingGrey}; padding: 0 0.125em; diff --git a/eq-author/src/App/page/Preview/QuestionPagePreview.js b/eq-author/src/App/page/Preview/QuestionPagePreview.js index 0c777197c2..2a1ec23e99 100644 --- a/eq-author/src/App/page/Preview/QuestionPagePreview.js +++ b/eq-author/src/App/page/Preview/QuestionPagePreview.js @@ -29,11 +29,6 @@ const Container = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: #dce5b0; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: #e0e0e0; padding: 0 0.125em; diff --git a/eq-author/src/App/questionConfirmation/Preview/index.js b/eq-author/src/App/questionConfirmation/Preview/index.js index 87b986557e..0202fc969f 100644 --- a/eq-author/src/App/questionConfirmation/Preview/index.js +++ b/eq-author/src/App/questionConfirmation/Preview/index.js @@ -32,11 +32,6 @@ const Container = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: #dce5b0; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: #5f7682; border-radius: 4px; diff --git a/eq-author/src/App/section/Preview/SectionIntroPreview.js b/eq-author/src/App/section/Preview/SectionIntroPreview.js index 67bb401b56..ba33dc7334 100644 --- a/eq-author/src/App/section/Preview/SectionIntroPreview.js +++ b/eq-author/src/App/section/Preview/SectionIntroPreview.js @@ -15,11 +15,6 @@ const Wrapper = styled.div` p:last-of-type { margin-bottom: 0; } - em { - background-color: #dce5b0; - padding: 0 0.125em; - font-style: normal; - } span[data-piped] { background-color: #e0e0e0; padding: 0 0.125em; diff --git a/eq-author/src/components/preview/elements/PageTitle.js b/eq-author/src/components/preview/elements/PageTitle.js index 4e4a56f613..d77f2589d3 100644 --- a/eq-author/src/components/preview/elements/PageTitle.js +++ b/eq-author/src/components/preview/elements/PageTitle.js @@ -8,6 +8,11 @@ const Title = styled.h1` font-size: 1.4em; margin: 0 0 1em; word-wrap: break-word; + strong { + background-color: #dce5b0; + padding: 0 0.125em; + font-style: normal; + } `; const PageTitle = ({ title, missingText = "Missing Page Title" }) => {