Comments (4)
Thanks for reporting this issue!
I think the parser should gracefully handle unpaired close tags. Let me look into this, similar to how browsers handle such case.
For self-closing tags such as <img>
, I think it's supported, but we don't have tests. I'll look into it too.
from budoux.
Thanks for reporting this. The change is due to the non-breaking markup support we introduced at #251, where we need to track the elements in a queue.
Could you elaborate your specific use case that you want to include a close tag with no corresponding open tag? I acknowledge that we need to improve the error message, but BudouX is intended to work with a valid document fragment.
from budoux.
Thanks. It was actually a content bug to have a missing open tag, but I thought worth reporting since it's a change in behaviour.
I don't need this to be a supported case, though maybe a nicer exception would be useful - otherwise happy for you to close as expected behaviour.
from budoux.
Thanks for your input. Raising a better exepction sounds like a plan.
That said, the element queue's emptiness is not enough to detect if the given HTML string is valid or not. The string like below will work with budoux==0.6.0
CLI even thought the string is not a valid HTML.
budoux --html "あの空を見る限り<img>今日はとてもいい天気ですね。</p>"
We may need to check void elements as well to manage the element queue and the document's validity better.
@kojiishi any thoughts on this?
from budoux.
Related Issues (20)
- [quality] "ありがとうございます。"
- [quality] まとめる HOT 1
- [configuration] Usage on browser's web worker
- [quality] Better Support for Japanese Hiragana Adverbs
- [quality] あなたの意図したとおりに情報を伝えることができます。 HOT 1
- [quality] あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら、うつくしい森で飾られたモリーオ市、郊外のぎらぎらひかる草の波。 HOT 1
- 禁則処理
- Consider to use DocumentFragment
- Styles does not propagate in BudouX Web Components
- Numbers become <a href="tel:">links even if <meta name="format-detection" content="telephone=no"> is set on iOS HOT 4
- Deduplicate separators when processing HTML HOT 3
- dart support HOT 1
- [Java] Java version emits close tag for self-closing tags
- [java] `HTMLProcessor.getText()` collapses whitespaces HOT 2
- [quality] "のみ"
- [quality] お問い合わせ
- [quality] いよいよ HOT 1
- Chrome M121 breaks <ruby> unittest HOT 4
- Clarification on the unicode used on the keys HOT 7
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 budoux.