Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

*ignore-namespaces* added so I can matched namespaced elements without

 specifying the namespace

I dont want to change the parser to somehow support namespaces, so instead
I made the matcher just ignore namespaces by default
  • Loading branch information...
commit 7bcc1a29fad261de51c4afa2a51f3924b0c1e720 1 parent d101227
@bobbysmith007 bobbysmith007 authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/compile.lisp
View
10 src/compile.lisp
@@ -1,5 +1,9 @@
(in-package :css)
+(defvar *ignore-namespaces* T
+ "ignore tag name spaces when matching, for now the parser
+ doesnt support parsing namespaced tags, so lets ignore tag namespaces")
+
(defun attrib-includes? (node attrib value)
(member value
(cl-ppcre:split "\\s+" (buildnode:get-attribute node attrib))
@@ -32,7 +36,11 @@
(defun make-elt-matcher ( tag )
(lambda (%node%)
"elt-matcher"
- (string-equal (dom:tag-name %node%) tag)))
+ (string-equal
+ (if *ignore-namespaces*
+ (second (cl-ppcre:split ":" (dom:tag-name %node%) :limit 2))
+ (dom:tag-name %node%))
+ tag)))
(defun make-attrib-matcher ( attrib match-type match-to )
"attrib-matcher"
Please sign in to comment.
Something went wrong with that request. Please try again.