[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/jade-mode e621d186c1 080/128: Merge pull request #36 from
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/jade-mode e621d186c1 080/128: Merge pull request #36 from tjefferson08/remove_hl_after_tags |
Date: |
Sat, 29 Jan 2022 08:24:48 -0500 (EST) |
branch: elpa/jade-mode
commit e621d186c187fbec058d6e5af53bf3e81c0c92d3
Merge: 73893e8d8f 544be1a87d
Author: Travis Jefferson <tjefferson@signpost.com>
Commit: Travis Jefferson <tjefferson@signpost.com>
Merge pull request #36 from tjefferson08/remove_hl_after_tags
match full tag decl. and un-hl subsequent content
---
example.jade | 3 ++-
jade-mode.el | 28 ++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/example.jade b/example.jade
index ba438263e6..95ebbf300d 100644
--- a/example.jade
+++ b/example.jade
@@ -5,7 +5,7 @@ html(lang="en")
body.bp
#container
#header
- h1.page-title= My.awesome. page #is awesome#
+ h1.page-title My.awesome. page #is awesome#
#nav
ul#nav_list something sweet
li
@@ -23,6 +23,7 @@ html(lang="en")
= 'this one' + "and this should too"
span this one shouldn't higlight strings or... .other #things if else
| this one shouldn't highlight strings, and the same goes for
.keywords #ok ?
+ div#paren.content.example(style = 'float-left') Content .here #should
be plain if for
#footer
#copywrite-text= locals
diff --git a/jade-mode.el b/jade-mode.el
index d1ab4ea46d..d6f8e14891 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -40,6 +40,15 @@ For detail, see `comment-dwim'."
"include" "yield" "mixin") 'words))
"Jade keywords.")
+(defvar jade-tag-re "[a-z][a-z0-9]*"
+ "Regexp used to match a basic html tag, e.g. link, a, div")
+
+(defvar jade-id-re "#[a-zA-Z][0-9a-zA-Z_\\-]*"
+ "Regexp used to match an ID literal, e.g. #id, #id-one_23")
+
+(defvar jade-class-re "[.][a-zA-Z][0-9a-zA-Z_\\-]*"
+ "Regexp used to match a class literal, e.g. .class, .class_name-123")
+
(defvar jade-double-quote-string-re "[\"]\\(\\\\.\\|[^\"\n]\\)*[\"]"
"Regexp used to match a double-quoted string literal")
@@ -66,6 +75,25 @@ For detail, see `comment-dwim'."
(,"^[ {2,}]*[a-z0-9_:\\-]*" 0 font-lock-function-name-face) ;; tag name
(,"^\\s-*\\(//.*\\)" 1 font-lock-comment-face t) ;; jade block comments
+ ;; remove highlighting from literal content following tag/class/id
+ ;; e.g. tag Inner text
+ ;; tag#id.class INNER text
+ (,(concat "^\\s-*"
+
+ ;; start with a basic html tag, an ID, or a class
+ "\\(" jade-tag-re "\\|" jade-id-re "\\|" jade-class-re "\\)"
+
+ ;; followed by zero or more of either an ID or a class
+ "\\(" jade-id-re "\\|" jade-class-re "\\)*"
+
+ ;; then an optional set of parens with JS inside
+ ;; TODO highlight JS in a meaningful way
+ "\\(" "(.*)" "\\)?"
+
+ ;; then a space (not an equals sign), and match the rest of the
line
+ ;; and remove any font-lock faces applied
+ "[ ]\\(.+\\)") 4 nil t)
+
;; remove highlighting from lines opening with a pipe `|'
;; e.g. | keywords like for should not be highlighted here
;; | I'm not supposed to highlight single quotes either
- [nongnu] elpa/jade-mode 4079475e60 029/128: Modify comment for font-lock-keywords matcher., (continued)
- [nongnu] elpa/jade-mode 4079475e60 029/128: Modify comment for font-lock-keywords matcher., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode d2c37c960b 060/128: Merge pull request #22 from Niluge-KiWi/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 86f0734689 055/128: add init.el boilerplate for flymake support in the README, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode b33e7017f7 052/128: Defvar instead of setq, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode fd1a442556 059/128: Add missing jade keywords "block append", "block prepend", "append" and "prepend", ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 992ed1e50d 046/128: single quoted strings are now properly highlighted., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 210825fd5e 032/128: Change class facename to font-lock-type-face., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 7ff3a4cb0a 035/128: Use local variables settings already in the sws-mode., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 0a9ddef0eb 090/128: tweak example.jade so it'll actually render, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 73893e8d8f 077/128: Merge pull request #34 from zonuexe/fix/auto-mode-tail-match, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode e621d186c1 080/128: Merge pull request #36 from tjefferson08/remove_hl_after_tags,
ELPA Syncer <=
- [nongnu] elpa/jade-mode 449df109fc 074/128: fix unbound variable reference in let binding, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 279df56bf9 100/128: add some tests for indentation (new file), ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 932a2fef33 095/128: [#46] start unit test file for highlighting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 473d29b5c2 091/128: move doctype in rendering order, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 8a25dd6702 024/128: Merge pull request #4 from travisjeffery/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 41351ec293 027/128: Add autoload declarations, explicit requires and ELPA package dependencies., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode c513eded33 045/128: the string doctype now works as a doctype keyword., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode a1cbadd84d 026/128: add .el file headers to enable automatic packaging - closes gh#6, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 4d2f58abd7 044/128: Merge https://github.com/brianc/jade-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 62c012c8d6 039/128: Improved Stylus comments syntax highlighting., ELPA Syncer, 2022/01/29