Comments (7)
Is it ok if I update to jsdom 9.2.1?
from htmlizer.
Ok, now I remember why I didn't update jsdom.
Htmlizer relies on jQuery.parseHTML for parsing HTML string to DOM nodes.
Upgrading to jsdom 3.1.2 or higher makes jQuery.parseHTML removes doctype,html,body and head tags. On jsdom 0.10.3 jQuery.parseHTML removes doctype only. Upgrading jsdom would cause a regression for anyone parsing entire documents (like here).
As a workaround, now I detect if document begins with a <html> tag and then use a different parsing trick. The limitation are:
- you can't parse a template that begins with a head or body tag. They will have to be wrapped inside an html tag.
- An empty head tag will always be present when parsing an entire document (I can work around that as well, but didn't, as it won't cause much harm I guess).
Tell me if you are ok with the above limitations.
from htmlizer.
@mwoc, upgrading to htmlizer 2 should be far easier. It doesn't depend on jsdom at all (except as a dev dep), is faster and has the same API (iirc).
from htmlizer.
@mwoc Yea, very few things have changed in htmlizer2. From the README file:
1. toDocumentFragment() method has been removed.
2. $element KO binding context cannot be used anymore.
3. template binding interface has changed. (It has become simpler).
BTW, has anyone noticed that knockout itself can be run on node (by first declaring a global window and document object)? As far as I've tested it, even ko.observable and change updates also works.
from htmlizer.
I'll take a look at upgrading to v2 then. I think I tried while I was upgrading to node v6, and something else broke when using htmlizer, probably hitting one of the API changes. Will let you know how it goes this time :)
from htmlizer.
@mwoc Did you solve your issues with v2?
from htmlizer.
I'm working now on updating to v2, and ran into issue #22 which I now remember earlier was the reason why I wanted to stick to v0.x for now.
from htmlizer.
Related Issues (18)
- TODO List HOT 1
- DOCTYPE lost when the template is a complete document HOT 14
- Quotes in attribute values not entitified HOT 1
- Update tests HOT 3
- data-i18n in development HOT 9
- Allow special data-bind binding in no conflict mode HOT 2
- Add an option to persist data-bind attributes HOT 9
- add support for nodejs 4.0 HOT 2
- Containerless if with not-condition ends render HOT 3
- Template expression not rendering, if its name is a variable HOT 3
- Preserve unrecognized data binding HOT 1
- More container-less bindings? HOT 2
- Containerless foreach changes HTML nodes
- Keep script tags
- Prefix for containerless bindings HOT 1
- <script> contents are being escaped HOT 1
- version bump HOT 1
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 htmlizer.