Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion html/help/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ window.document.body.onload = () => {
// notify vscode when code is clicked:
if(document.body.classList.contains('preClickable')){
const codeElements = document.getElementsByTagName('pre');
console.log(codeElements);
for(let i=0; i<codeElements.length; i++){
const el = codeElements[i];
el.onclick = (me: MouseEvent) => {
Expand Down
8 changes: 7 additions & 1 deletion src/helpViewer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,13 @@ function pimpMyHelp(helpFile: HelpFile): HelpFile {
if(helpFile.isHtml){
// Remove style elements specified in the html itself (replaced with custom CSS)
$('head style').remove();


// strip tags: <code class="language-R">...
const preCodes = $('pre>code');
preCodes.each((_, pc) => {
$(pc).replaceWith($(pc).html() || '');
});

// Split code examples at empty lines:
const codeClickConfig = config().get<CodeClickConfig>('helpPanel.clickCodeExamples');
const isEnabled = CODE_CLICKS.some(k => codeClickConfig?.[k] !== 'Ignore');
Expand Down