Add the option showOriginalLineNumber,#51
Conversation
…tput, with the line numbers of input text.
|
Hi @borgar , |
|
I am sincerely sorry for the failure to reply to this. The notification came up just before I had to take a leave for health reasons and I had forgotten everything once I returned. It was by no means my intention to make little of the time and work you have put into this. I am onboard with having this kind of offset info in the output but I feel this would be an opportunity to take things a little further than you have done here. I have some ideas that I want to explore over the weekend that might make this reduce complexity instead of adding to it. Allow me to intrude a bit more on your already tested patience to hack at this over the weekend before I make up my mind. My ideas, should you be curious:
|
|
Nice to see that you are interested by this feature ! I had to stop looking at this after June for personal reasons, and now I'm back on it : Mainly, publishing my work based on it (If you are interested, we can talk about it by mail : see my profile). If you want some help to update your live test page with it, I can do it once you have stabilized the API : I'm not interested in maintaining my fork, and I think it's better when people can rely on only one repository. My feelings :
|
|
Resurrecting a very old thread here :) Did this come close to any kind of completion? We would very much like this feature, too. |
|
@craigkovatch : you can use the master branch of my fork. The feature you need is totally operational, tested, and used in the VSCode textile extension published in another repo of my github space. |
|
I am working on a much needed update of the library that includes a better parse tree where nodes are tagged with source offsets, making it easy to link output nodes to input lines. I am hoping to be able to release the update around the start of April. |
|
@borgar that sounds great! It turns out the fork is not super useful to us because we want to manipulate the textile parse tree, i.e. before it has been transformed to jsonml. Is it possible to hook into this stage somehow? Seems unexposed, even internally, currently. |
I am replacing jsonml entirely with a better structure (more akin to HTML DOM elements). For the very reason that I wanted the option to apply transformations to the tree before rendering. To solve things like #42, you would do something this: const tree = textile.parseTree(`"google 2":javascript:alert('XSS')`);
tree.visit(node => {
if (node.attr.href) {
node.attr.href = escapeJSUrl(node.attr.href);
}
});
I will get this up here as a pull request asap. The branch is functional but needs more tests and cleanup work. It would be good to get some feedback, so if you want to test then that could be ideal for everyone. 🙂 |
|
An work-in-progress next version is now accessible: #69 |
|
I'm closing this PR as the #69 supersedes it. |
Add the option showOriginalLineNumber, to map the elements of HTML output, with the line numbers of input text.