File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed
Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -843,6 +843,19 @@ export const tests: [
843843 ] ,
844844 "star tag namespace" ,
845845 ] ,
846+ [
847+ "|bar" ,
848+ [
849+ [
850+ {
851+ name : "bar" ,
852+ type : "tag" ,
853+ namespace : "" ,
854+ } ,
855+ ] ,
856+ ] ,
857+ "without namespace" ,
858+ ] ,
846859 [
847860 "*|*" ,
848861 [
@@ -870,6 +883,21 @@ export const tests: [
870883 ] ,
871884 "basic attribute namespace, existential" ,
872885 ] ,
886+ [
887+ "[|bar]" ,
888+ [
889+ [
890+ {
891+ action : "exists" ,
892+ name : "bar" ,
893+ type : "attribute" ,
894+ namespace : "" ,
895+ value : "" ,
896+ } ,
897+ ] ,
898+ ] ,
899+ "without namespace, existential" ,
900+ ] ,
873901 [
874902 "[foo|bar='baz' i]" ,
875903 [
Original file line number Diff line number Diff line change @@ -391,6 +391,10 @@ function parseSelector(
391391 selectorIndex += 1 ;
392392 name = "*" ;
393393 } else if ( reName . test ( selector . slice ( selectorIndex ) ) ) {
394+ if ( selector . charAt ( selectorIndex ) === "|" ) {
395+ namespace = "" ;
396+ selectorIndex += 1 ;
397+ }
394398 name = getName ( 0 ) ;
395399 } else {
396400 /*
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ function getNamespacedName(token: {
106106}
107107
108108function getNamespace ( namespace : string | null ) : string {
109- return namespace
109+ return namespace !== null
110110 ? `${ namespace === "*" ? "*" : escapeName ( namespace ) } |`
111111 : "" ;
112112}
You can’t perform that action at this time.
0 commit comments