Skip to content

Commit

Permalink
Merge pull request #47 from punchagan/fix-double-quote-in-value
Browse files Browse the repository at this point in the history
Escape any double quote already in value when wrapping it in quotes
  • Loading branch information
kaushalmodi authored Jul 24, 2017
2 parents c5588d5 + c7bcd23 commit ecb7119
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions example-site/content-org/all-posts.org
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ Something 2.1
** Foo ( Bar ) Baz
** (Foo)Bar.Baz&Zoo
** Hey! I have a link [[https://example.org][here]] (Awesome!)
* Awesome title with "quoted text"
:PROPERTIES:
:EXPORT_FILE_NAME: post-title-quotes
:EXPORT_DATE: 2017-07-22T13:46:33-04:00
:END:

Testing a post with quotes in the title

* Excluded post :noexport:
:PROPERTIES:
:EXPORT_FILE_NAME: excluded-post
Expand Down
2 changes: 1 addition & 1 deletion ox-hugo.el
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ string with just alphanumeric characters."
(string-match-p "\\`[a-zA-Z0-9]+\\'" val))
val)
(t
(concat "\"" val "\""))))
(concat "\"" (replace-regexp-in-string "\"" "\\\\\"" val) "\""))))

(defun org-hugo--parse-menu-prop-to-alist (str)
"Return an alist converted from a string STR of Hugo menu properties.
Expand Down

0 comments on commit ecb7119

Please sign in to comment.