colorize namedcolor followed by ! without a space
This commit is contained in:
		
							parent
							
								
									bbfda6d33b
								
							
						
					
					
						commit
						885919e7d9
					
				|  | @ -44,7 +44,7 @@ | ||||||
|     '(' + |     '(' + | ||||||
|       RX_COLOR.hex.source + '|' + |       RX_COLOR.hex.source + '|' + | ||||||
|       '(?:rgb|hsl)a?(?=\\()|(?:' + [...colorConverter.NAMED_COLORS.keys()].join('|') + ')' + |       '(?:rgb|hsl)a?(?=\\()|(?:' + [...colorConverter.NAMED_COLORS.keys()].join('|') + ')' + | ||||||
|       '(?=[\\s;(){}[\\]/"]|$)' + |       '(?=[\\s;(){}[\\]/"!]|$)' + | ||||||
|     ')', 'gi'); |     ')', 'gi'); | ||||||
|   const RX_DETECT_FUNC = /(rgb|hsl)a?\(/iy; |   const RX_DETECT_FUNC = /(rgb|hsl)a?\(/iy; | ||||||
| 
 | 
 | ||||||
|  | @ -368,6 +368,11 @@ | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       color = text.slice(start, isFunc ? text.indexOf(')', end) + 1 : end); |       color = text.slice(start, isFunc ? text.indexOf(')', end) + 1 : end); | ||||||
|  |       const j = !isHex && !isFunc && color.indexOf('!'); | ||||||
|  |       if (j > 0) { | ||||||
|  |         color = color.slice(0, j); | ||||||
|  |         end = start + j; | ||||||
|  |       } | ||||||
|       const spanState = markedSpans && checkSpan(); |       const spanState = markedSpans && checkSpan(); | ||||||
|       if (spanState === 'same') continue; |       if (spanState === 'same') continue; | ||||||
|       if (checkColor()) { |       if (checkColor()) { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user