Comments (3)
From [email protected] on August 15, 2011 23:15:29
My apologies for the bad fix. One that actually works is to change the _sectionHeadingText function to return HTML-escaped text. If I'm not mistaken & and < are the only characters that need to be escaped in HTML, so this can be done manually.
Although a much better solution would be to use DOM methods throughout to build HTML content, instead of working with strings and having to worry about such things.
from h5o-js.
From dymonaz on August 16, 2011 02:31:31
Ooops...
Status: Accepted
from h5o-js.
From [email protected] on August 16, 2011 23:59:58
By the way, I followed my own suggestion and created a more complete implementation of the algorithm which I believe is more sound: https://github.com/hoyois/html5outliner I tested it on w3c pages and it seems to work. Feel free to borrow from it, as I think I'm going to steal your bookmarklet idea and make myself a cool bookmarklet :)
from h5o-js.
Related Issues (20)
- Detect headings in <details> tag HOT 1
- Get the content of a section HOT 3
- Add an option to skip the top-level header when generating a ToC
- Look for IDs on the first heading in a section, not just the section
- No text content inside h1 with nested image HOT 2
- Support cleaner oceans video link is broken HOT 1
- Cleanup: make tests run/pass again
- Cleanup: make chrome extension into an npm package
- Cleanup: split bookmarklet out into an npm package HOT 1
- Cleanup: extract asHtml to not be part of Outline/Section
- Testing: automatically run tests in phantomjs
- Docs: split off h5o.github.io repo HOT 1
- Display rendered bookmarklet output inside an iframe
- Update to the latest version of the algorithm
- Implement the "associated nodes" part of the algorithm HOT 1
- Auto-publish in npm with Travis
- Element tagName check is using partial match
- Outlines on Wikipedia include undesirable [edit] text HOT 1
- Support role="heading", aria-level HOT 1
- Typo in `asHTML.js`?
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 h5o-js.