Skip to content

Instantly share code, notes, and snippets.

@wujiang
Created March 12, 2014 13:47
Show Gist options
  • Save wujiang/9507248 to your computer and use it in GitHub Desktop.
Save wujiang/9507248 to your computer and use it in GitHub Desktop.
Surround option words with quotes
;; Surround option words with quotes
;; It's helpful for making javascript work with IE.
;; i.e.:
;;
;; title: {
;; text: "highcharts example"
;; },
;; exporting: {
;; enabled: false
;; },
;;
;; becomes
;;
;; "title": {
;; "text": "highcharts example"
;; },
;; "exporting": {
;; "enabled": false
;; },
(while (re-search-forward "[a-zA-Z]+:" nil t)
(goto-char (match-beginning 0))
(insert "\"")
(goto-char (match-end 0))
(insert "\""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment