invalid parsed selector, question about url() and built-in types
- Lenguaje dominante
- Python
- Estrellas
- 17
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hello,
I'm using css lib to parse styles uploaded by users and then do some validation rules. First problem is about inproperly parsed selectors, for example:
```
#editTemporaryPriceList,
#addTemporaryPriceList,
#addPriceList { font-size: 1.2em; display: block; color: #333; text-decoration: underline; margin-top: 10px; padding-bottom: 3px; }
```
is parsed as:
```
(None, {'pseudo': [], 'attrib': [], 'hash': ['editTemporaryPriceList'], 'class': []})
(None, {'pseudo': [], 'attrib': [], 'hash': ['#addTemporaryPriceList'], 'class': []})
(None, {'pseudo': [], 'attrib': [], 'hash': ['#addPriceList'], 'class': []})
```
(# at the begging of 'hash' in two selectors)
The second problem is about attributes with url(). Why url() is stripped from value?
Third and the last problem is about built-in types. For example Percentage, Length, Rgb. I'm trying to create cleaned sheet from CSSStyleSheet, but i'm unable to check if attribute value is type of Length or other. When I import those classes from codetalker, 'isinstance' always return False and i need to do some hasattr checks to discover value's type. Is there any other way to do that?
It would be great if css could work in both ways (parse and print).
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza reproduciendo los tres ejemplos con el CSS parser y CSSStyleSheet; después inspecciona el selector, el valor de url() y el manejo de tipos incorporados de codetalker. Compara la salida analizada con el CSS original y define como terminado el trabajo cuando se conserven los selectores y los valores de url() y se expongan comprobaciones de tipo fiables; añade cobertura de regresión para cada caso.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 20/100