Comments (10)
I'm perfectly happy to take a pull request.
Date: Thu, 20 Sep 2012 14:14:29 -0700
From: [email protected]
To: [email protected]
Subject: [ExCSS] Space in font names lost (#6)
A CSS like this:
body
{
font: normal 100% Frutiger, "Frutiger Linotype" , Univers, Calibri, "Gill Sans" , "Gill Sans MT" , "Myriad Pro" , Myriad, "DejaVu Sans Condensed" , "Liberation Sans" , "Nimbus Sans L" , Geneva, "Helvetica Neue" , Helvetica, Arial, sans-serif;
}
after parsed will have font names without spaces, like FrutigerLinotype.
What can I do?
—
Reply to this email directly or view it on GitHub.
from excss.
Well, if you pinpoint me where to look for the issue I can make a try :-).
from excss.
It's hard to know just where to point you. Sadly, Coco/r is not white space sensitive. There are a few functions at the top of the ATG file that try to help where Coco/r fails. Probably the best place to look would be the unit tests. You'll see tests for most areas of the code base. I'd add one that fails and then see on or about what area of the parser causes the trouble. I've done what I can to document the ATG file so it can be tracked down.
I hope that's clear enough. I'll try the doing same and share my findings. Another pair of eyes is always better!
Date: Thu, 20 Sep 2012 14:40:56 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [ExCSS] Space in font names lost (#6)
Well, if you pinpoint me where to look for the issue I can make a try :-).
—
Reply to this email directly or view it on GitHub.
from excss.
Oh damn, I forgot the parser was generated from Coco/r... The problem is that this is completely foreign to me. Nevertheless I'll look at the places you advised.
from excss.
Yea - not exactly an easy "language" to learn. Attributed Grammar is... interesting. My hope in the long run is to either switch to a more readable and white space friendly parser like Ragel, or try to port Chrome's CSS Engine. Chrome uses a parses as well, but for their lower level C/C++ code.
Date: Wed, 26 Sep 2012 14:11:12 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [ExCSS] Space in font names lost (#6)
Oh damn, I forgot the parser was generated from Coco/r... The problem is that this is completely foreign to me. Nevertheless I'll look at the places you advised.
—
Reply to this email directly or view it on GitHub.
from excss.
I forked the project and after managing to build it (due to the path containing spaces the copy command initially failed, thus building too) I can't run the tests with the TestDriven.Net plugin (it starts, then immediately finishes and says that run = failed = succeeded = 0 tests...). Is there some special config needed?
from excss.
Now I started experimenting around by simply running the project with a test console app. It turns out that if the font names are not in quotes the spaces remain. Since the quoted version is also valid CSS, the problem remains, however.
I digged around a bit with the debugger, here are my findings:
Probably root of the problem is that a space-separated, quote font name is recognized as two tokens. Its parsing goes through Parser.QuotedStringPreserved() and since there tokens are concatenated on ln 403 the space goes away. The root of this is that in Scanner.NextToken() ln 397 if the current character is a space the expression returns false, so on ln 398 the value of the variable t will be a token only containing the first part of the font name.
What do you think?
from excss.
Hi, any updates on this?
from excss.
I have a bit of update - more of a change in direction. I've reached the end of what Coco/r is capable of. It's simply not the right tool for the job given it's inability to parse white space properly. I'm working on converting the whole project over to use Ragel as the lexer generator.
from excss.
Oh wow. Thanks for the update, this looks great.
Any estimate on when you can complete the converting?
from excss.
Related Issues (20)
- Janky at-rule catches FillDeclaration in an infinite loop HOT 3
- Can't parse this code, waiting for a long, long time HOT 5
- Font size rule doesn't allow functions HOT 3
- Changelog for Releases HOT 7
- ClipPath property is empty
- ListSelector should be a public class HOT 2
- Certain comments is breaking the parser and hex colours are converted to rgb colours HOT 3
- NullReferenceException in ToCss() in v0.4.2
- Parsing z-index values outside of int range throws an OverflowException HOT 5
- Selector with attribute matching throws exception on WebGL build HOT 1
- JustifyContent always parses to empty string
- Everything's that's useful is internal HOT 1
- Flex: auto should be parsed to "flex: 1 1 auto" instead of "flex: 0 1 auto"
- animation-name is being converted to lower case which affects the resulting css
- Discarding of "invalid" property values - way to keep in parsed object? HOT 1
- justify-content update breaks the following css (Starting with 4.2.3) HOT 1
- Copyright placeholder in your license.txt file HOT 1
- Support for *-block and *-inline properties
- opacity can not parse when is 84%
- How to use selectors? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from excss.