diff --git a/lib/markdown-preview-view.coffee b/lib/markdown-preview-view.coffee index e3f5dcb..2c05563 100644 --- a/lib/markdown-preview-view.coffee +++ b/lib/markdown-preview-view.coffee @@ -202,14 +202,16 @@ class MarkdownPreviewView extends ScrollView getMarkdownPreviewCSS: -> markdowPreviewRules = [] - ruleRegExp = /\.markdown-preview/ + packageRuleCSSRegExp = /\.markdown-preview/ + baseCSSRegExp = /bootstrap\.less$/ cssUrlRefExp = /url\(atom:\/\/markdown-preview\/assets\/(.*)\)/ for stylesheet in @getDocumentStyleSheets() if stylesheet.rules? + isBaseCSS = stylesheet.ownerNode?.sourcePath?.match(baseCSSRegExp)? for rule in stylesheet.rules - # We only need `.markdown-review` css - markdowPreviewRules.push(rule.cssText) if rule.selectorText?.match(ruleRegExp)? + # We only need `.markdown-review` css and base css + markdowPreviewRules.push(rule.cssText) if isBaseCSS || rule.selectorText?.match(packageRuleCSSRegExp)? markdowPreviewRules .concat(@getTextEditorStyles()) diff --git a/spec/fixtures/saved-html.html b/spec/fixtures/saved-html.html index cbd4b7b..1136adf 100644 --- a/spec/fixtures/saved-html.html +++ b/spec/fixtures/saved-html.html @@ -5,6 +5,7 @@ code-block