Notes

tagged fragmention

Kartik Prabhu
replied to a post on kartikprabhu.com with
So there are a bunch of things going on with fragmentions and non-break spaces * fragmention.js replaces all whitespaces by a normal space while searching for text https://github.com/chapmanu/fragmentions/commit/05a8200296aa78de1f9ed84c4801f5d8c42b18b1#diff-d5b8b19887d954fd0540ec90d72414a9R11. Now while getting a selection using “window.getSelection().toString()” and encoding it with “encodeURI()” browsers seem to do different things (see demo test: https://kartikprabhu.com/static/demo/selection-encodeURI.html ) * Chrome simply encodes non-break space to UTF-8 “%C2%A0”. * Firefox replaces a non-break space with normal space and encodes it to “%20”. Bug filed here: https://bugzilla.mozilla.org/show_bug.cgi?id=1324907 To take this into account, I changed the fragmentioner.js script to simply replace the whitespaces in the selection text with normal spaces before constructing the fragmention URL https://github.com/kartikprabhu/fragmentioner/commit/3e578a5e13e311e62053f3b9c2a5edbf5f4804f5#diff-fd4672195ceec838f040facacc154022R85.
Kartik Prabhu
replied to a post on adactio.com with
Update: Non-break spaces seems to be a problem in Chrome but not in Firefox; on the other hand ampersands work in both! Non-break spaces seem to work with my fragmentioner script. See the demo test https://kartikprabhu.com/static/demo/fragmention.html#non-breaking%20space++2 My script is https://github.com/kartikprabhu/fragmentioner.
Kartik Prabhu
2017 indieweb commitments * remove the over-zealous fragmention handling in receiving webmentions which assumes the double-hash “##” notation; use whatever URL is received. update marginalia to accept this. * delete the responses container if all responses are marginalia. * remove marginalia.js from notes (since it is useless there), and put only on article permalink pages. * fix responsive images height issue: currently my responsive images don’t know their heights and so cause flow when they load. This interferes with fragmention for instance. * fix hfeed2atom to display response-context in the Atom feed. * develop a mf2-format for a bibliography to represent metadata of scientific papers in HTML+mf2. Use it to get better representation of data on https://kartikprabhu.com/papers. Prior-art: bibtex format, Atom/RSS from http://arxiv.org, others?
Kartik Prabhu
replied to a post on Twitter with
Glad you found it useful. The original fragmention script is by @jon_neal though. I might post marginalia to your wook while reading.