Skip to content

Commit

Permalink
add fontification to JSX text using font-lock-string-face
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeochoa committed Aug 8, 2017
1 parent 4db1fc0 commit 4a24c86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rjsx-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ the `:around' combinator. JS2-PARSER is the original XML parser."
"`rjsx-mode' face used to highlight JSX attribute names."
:group 'rjsx-mode)

(defface rjsx-text
'((t . (:inherit font-lock-string-face)))
"`rjsx-mode' face used to highlight JSX text."
:group 'rjsx-mode)


;;;; Parser constants struct definitions

Expand Down Expand Up @@ -692,6 +697,7 @@ and {}-bracketed expressions. Return the parsed child."

((= tt rjsx-JSX-TEXT)
(rjsx-maybe-message "text node: '%s'" (js2-current-token-string))
(js2-set-face (js2-current-token-beg) (js2-current-token-end) 'rjsx-text 'record)
(js2-record-text-property (js2-current-token-beg) (js2-current-token-end)
'syntax-table (standard-syntax-table))
(make-rjsx-text :value (js2-current-token-string)))
Expand Down

0 comments on commit 4a24c86

Please sign in to comment.