Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accept relative CSS stylesheets #389

Closed
wants to merge 1 commit into from
Closed
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: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
- Support horizontal rules consisting of underscores.
- Change default character encoding to UTF-8.
([GH-340][], [GH-350][])
- Allow relative CSS stylesheets paths.

* Bug fixes:

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ provides an interface to all of the possible customizations:
(default: `t`).

* `markdown-css-paths` - CSS files to link to in XHTML output
(default: `nil`).
(default: `nil`). These can be either local files (relative or
absolute) or URLs.

* `markdown-content-type` - used to set to the `http-equiv`
attribute to be included in the XHTML `<head>` block (default:
Expand Down
6 changes: 4 additions & 2 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ Math support can be enabled, disabled, or toggled later using
:package-version '(markdown-mode . "2.4"))

(defcustom markdown-css-paths nil
"URL of CSS file to link to in the output XHTML."
"List of URLs of CSS files to link to in the output XHTML."
:group 'markdown
:type '(repeat (string :tag "CSS File Path")))

Expand Down Expand Up @@ -7320,7 +7320,9 @@ Standalone XHTML output is identified by an occurrence of

(defun markdown-stylesheet-link-string (stylesheet-path)
(concat "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\""
stylesheet-path
(or (and (string-prefix-p "~" stylesheet-path)
(expand-file-name stylesheet-path))
stylesheet-path)
"\" />"))

(defun markdown-add-xhtml-header-and-footer (title)
Expand Down