Comments (4)
I just pushed a change that does the resolution in the parser.
But this can always be reverted. I see both sides of it. Note that we could still say that parser implementations aren't required to implement emoji lookup -- the renderer could still do its own lookup on the alias provided.
from djot.
The reason I did it this way is that renderers that consume the AST might make different decisions about how to render the emoji. For example, a djot renderer might want :smile:
, while in HTML you'd probably want 😄
Another reason isl to avoid requiring the parser to have the big emoji table. So, for example, :oeu:
gets parsed as an emoji with alias oeu
; the renderer will look this up, not find it, and have to figure out what to do.
from djot.
I can see why it would be convenient to have the entity resolved to unicode in the AST.
(That would free the consumer of the need to do the substitution, and why not? since we have the entity table in djot.)
from djot.
might make different decisions about how to render the emoji.
This I think is addressed by having both text
and raw
.
Another reason isl to avoid requiring the parser to have the big emoji table
This sounds very convincing to me. And, if we don't substitute emojis, substituting em,en dashes, quotes and ellipsis doesn't make sense (they are a drop in the bucket).
I guess what would help here is to have a canonical table with substitution as a part of the spec, so that:
- users have an expected amount of subsitutions which work the same across implementations
- implementations can be easily consistent by building of the same source of truth.
and why not? since we have the entity table in djot.)
I think a good argument to not do this is to make sure that consumers actually can work with implementations which doesn't bundle an emoji table. That is, if the ref impl does this because "why not?", then every other impl would be pushed to do this anyway.
from djot.
Related Issues (20)
- SyntaxError after installation HOT 4
- Code generation from ast.ts/djot-schema.json HOT 3
- Templating, symbols and conditionals
- Class names for spans similar to divs HOT 7
- Proposal: explicit syntax for custom tags HOT 9
- Possible parsing ambiguity: attribute key starting with punctuation HOT 7
- Is a backslashed space still whitespace? HOT 5
- Why aren't comments in the AST? HOT 2
- Allow attributes for list items, table cells and rows
- how are block elements recognized? HOT 2
- Comment syntax is unclear HOT 1
- Style change doesn't break task lists HOT 1
- Clarification on tab indentation rules HOT 3
- SSL_ERROR_BAD_CERT_DOMAIN for djot.net HOT 3
- "flag" attributes HOT 3
- Standalone attributes HOT 6
- Attribute references HOT 4
- Playground should provide examples
- Tables with a column of th elements HOT 1
- Typo in syntax.md
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 djot.