Skip to content

Commit aecf04d

Browse files
fix pilcrow problem, set targets to open same page
1 parent ddcf9a4 commit aecf04d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/htmldoc/static/js/filter_models.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,17 @@ function displayModels(models) {
124124
// Use DOMParser to parse the HTML content
125125
const parser = new DOMParser();
126126
const doc = parser.parseFromString(htmlContent, "text/html");
127-
const firstHeading = doc.querySelector("h1") ? doc.querySelector("h1").textContent : "No Heading";
127+
let firstHeading = doc.querySelector("h1") ? doc.querySelector("h1").textContent : "No Heading";
128128

129+
// Remove pilcrow character
130+
firstHeading = firstHeading.replace(/\W$/g, '');
129131
// Create the link with model name and first heading
130132
const link = document.createElement('a');
131133
const modelBaseName = model.split('/').pop().replace('.html', ''); // Extract base name for display
132134
link.href = model; // Use the full model path directly
133135
link.textContent = `${firstHeading}`; // Include the first heading
134136
link.className = 'model-link'; // For CSS styling
135-
link.target = '_blank'; // Opens link in a new tab
137+
// link.target = '_blank'; // Opens link in a new tab
136138

137139
// Create a list item and append the link
138140
const li = document.createElement('li');

0 commit comments

Comments
 (0)