You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
It would be nice to disable the default CSS if I'm using my own custom CSS with the markdown-pdf.styles option as the default one can interfere with custom styling.
All you have to do is to make the inclusion of the default CSS dependent of the number of defined custom styles. (Basically move lines 430 and 431 to the else branch of the if on line 435 in extension.js)
// 1. read the style of the markdown.styles setting.styles=vscode.workspace.getConfiguration('markdown')['styles'];if(styles&&Array.isArray(styles)&&styles.length>0){for(i=0;i<styles.length;i++){varhref=filename=styles[i];varprotocol=url.parse(href).protocol;if(protocol==='http:'||protocol==='https:'){style+='<link rel=\"stylesheet\" href=\"" + href + "\" type=\"text/css\">';}elseif(protocol==='file:'){style+=makeCss(filename);}}}else{// 2. read the style of the vscode.filename=path.join(__dirname,'styles','markdown.css');style+=makeCss(filename);}
Another option would be to include a markdown-pdf.useDefaultStyle setting.
The text was updated successfully, but these errors were encountered:
vimtaai
changed the title
Exclude default CSS the styles configuration is set
Exclude default CSS if the styles configuration is set
Jan 17, 2018
Hi!
It would be nice to disable the default CSS if I'm using my own custom CSS with the
markdown-pdf.styles
option as the default one can interfere with custom styling.All you have to do is to make the inclusion of the default CSS dependent of the number of defined custom styles. (Basically move lines
430
and431
to theelse
branch of theif
on line435
inextension.js
)vscode-markdown-pdf/extension.js
Line 430 in ff211ed
Proposed code snippet (
extension.js
)Another option would be to include a
markdown-pdf.useDefaultStyle
setting.The text was updated successfully, but these errors were encountered: