|
|
@@ -5,6 +5,9 @@ import urljoin from 'url-join';
|
|
|
|
|
|
import LinkedPagePath from '../models/linked-page-path';
|
|
|
|
|
|
+const HIGHLIGHT_START_TAG = '<em class="highlighted-keyword">';
|
|
|
+const HIGHLIGHT_END_TAG = '</em>';
|
|
|
+
|
|
|
|
|
|
const PagePathHierarchicalLink = (props) => {
|
|
|
const {
|
|
|
@@ -37,11 +40,19 @@ const PagePathHierarchicalLink = (props) => {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ const removeHighlightTag = (href) => {
|
|
|
+
|
|
|
+ if (href.includes(HIGHLIGHT_START_TAG) && href.includes(HIGHLIGHT_END_TAG)) {
|
|
|
+ return href.replaceAll(HIGHLIGHT_START_TAG, '').replaceAll(HIGHLIGHT_END_TAG, '');
|
|
|
+ }
|
|
|
+ return href;
|
|
|
+ };
|
|
|
+
|
|
|
const isParentExists = linkedPagePath.parent != null;
|
|
|
const isParentRoot = linkedPagePath.parent?.isRoot;
|
|
|
const isSeparatorRequired = isParentExists && !isParentRoot;
|
|
|
|
|
|
- const href = encodeURI(urljoin(basePath || '/', linkedPagePath.href));
|
|
|
+ const href = encodeURI(urljoin(basePath || '/', removeHighlightTag(linkedPagePath.href)));
|
|
|
|
|
|
// eslint-disable-next-line react/prop-types
|
|
|
const RootElm = ({ children }) => {
|