Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Better parser #9

Open
sairion opened this issue Sep 2, 2015 · 4 comments
Open

Better parser #9

sairion opened this issue Sep 2, 2015 · 4 comments
Assignees

Comments

@sairion
Copy link
Collaborator

sairion commented Sep 2, 2015

simple-html-tokenizer has some problem. First of all, it does not understand HTML and SVG namespace and elements correctly (which makes us to expand self-closing tag manually via regex)

Secondly, it just gives array of parsed tag sequence rather than structured object. This makes code quite verbose (which I did not realize at first use)

simple-html-tokenizer is pretty fast and lightweight but we need parser with better output.

@sairion sairion self-assigned this Mar 4, 2016
@sairion
Copy link
Collaborator Author

sairion commented Mar 9, 2016

@ianwalter
Copy link

How about using SVGO instead of the custom code? There are loaders for SVGO but I don't think I have been able to find any that inline the SVG for you and is platform-independent (i.e. you could use on React or Vue).

@sairion
Copy link
Collaborator Author

sairion commented Mar 19, 2016

@ianwalter I believe you can use svgo-loader + raw-loader to have almost same, or better effect this loader gives. In fact svg inlining is pretty much nothing but pasting contents into a webpack module (which raw-loader does). For the matter of fact, this loader should work platform-independent either. I built this loader for lower install overhead because svgo-loader (or svgo) has a bit huge for small tasks.

@ianwalter
Copy link

@sairion Thanks, I came to the same conclusion (except using text-loader instead of raw-loader). Cheers!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants