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

Change default character encoding #350

Merged
merged 1 commit into from
Jul 31, 2018
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -749,19 +749,19 @@ provides an interface to all of the possible customizations:
* `markdown-css-paths` - CSS files to link to in XHTML output
(default: `nil`).

* `markdown-content-type` - when set to a nonempty string, an
`http-equiv` attribute will be included in the XHTML `<head>`
block (default: `""`). If needed, the suggested values are
`application/xhtml+xml` or `text/html`. See also:
`markdown-coding-system`.
* `markdown-content-type` - used to set to the `http-equiv`
attribute to be included in the XHTML `<head>` block (default:
`"text/html"`). Set to an alternate value `application/xhtml+xml`
if needed, or set to an empty string to remove the attribute. See
also: `markdown-coding-system`.

* `markdown-coding-system` - used for specifying the character
set identifier in the `http-equiv` attribute when included
(default: `nil`). See `markdown-content-type`, which must
be set before this variable has any effect. When set to `nil`,
be set for this variable to have any effect. When set to `nil`,
`buffer-file-coding-system` will be used to automatically
determine the coding system string (falling back to
`iso-8859-1` when unavailable). Common settings are `utf-8`
`utf-8` when unavailable). Common settings are `iso-8859-1`
and `iso-latin-1`.

* `markdown-xhtml-header-content` - additional content to include
Expand Down
12 changes: 6 additions & 6 deletions markdown-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,17 @@ Math support can be enabled, disabled, or toggled later using
:group 'markdown
:type '(repeat (string :tag "CSS File Path")))

(defcustom markdown-content-type ""
(defcustom markdown-content-type "text/html"
"Content type string for the http-equiv header in XHTML output.
When set to a non-empty string, insert the http-equiv attribute.
Otherwise, this attribute is omitted."
When set to an empty string, this attribute is omitted. Defaults to
`text/html'."
:group 'markdown
:type 'string)

(defcustom markdown-coding-system nil
"Character set string for the http-equiv header in XHTML output.
Defaults to `buffer-file-coding-system' (and falling back to
`iso-8859-1' when not available). Common settings are `utf-8'
`utf-8' when not available). Common settings are `iso-8859-1'
and `iso-latin-1'. Use `list-coding-systems' for more choices."
:group 'markdown
:type 'coding-system)
Expand Down Expand Up @@ -7313,7 +7313,7 @@ Standalone XHTML output is identified by an occurrence of
"<head>\n<title>")
(insert title)
(insert "</title>\n")
(when (> (length markdown-content-type) 0)
(unless (= (length markdown-content-type) 0)
(insert
(format
"<meta http-equiv=\"Content-Type\" content=\"%s;charset=%s\"/>\n"
Expand All @@ -7325,7 +7325,7 @@ Standalone XHTML output is identified by an occurrence of
(and (fboundp 'coding-system-get)
(coding-system-get buffer-file-coding-system
'mime-charset))
"iso-8859-1"))))
"utf-8"))))
(if (> (length markdown-css-paths) 0)
(insert (mapconcat #'markdown-stylesheet-link-string
markdown-css-paths "\n")))
Expand Down