You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I was looking for a library that would allow me to identify html ranges based off index in the plaintext, and Rangy looked like a good fit.
Unfortunately I need to use it on html that is not currently rendered, and I'm not sure that's supported. When trying to implement a proof of concept that used a Document object that I created (rather than the current document or a document in an iframe or other window) I ran into issues where Rangy was trying to get info on the window, to determine computedStyles for elements , I think.
This caused an error ERROR TypeError: "getWindow(...) is null"
which occurs in this file
after running moveStart method.
I can't seem to find others who've encountered the same issue and wonder if I'm missing something or if there may be another tool that will allow me to do something like the following:
Give me the range within this Document/document-fragment Object that contains the text that starts X characters in (not including HTML tags etc, just plain text) and ends Y characters in.
It looks to me that Rangy could accomplish this using the textModules moveStart and moveEnd methods.. if they'd only work on DocumentObjects and not require access to the window.
If I've got something wrong, or if this doesn't quite constitute an issue, my apologies! not sure where else to ask the question
Would love to hear any suggestions
Thanks!
The text was updated successfully, but these errors were encountered:
Hi there, I was looking for a library that would allow me to identify html ranges based off index in the plaintext, and Rangy looked like a good fit.
Unfortunately I need to use it on html that is not currently rendered, and I'm not sure that's supported. When trying to implement a proof of concept that used a Document object that I created (rather than the current document or a document in an iframe or other window) I ran into issues where Rangy was trying to get info on the window, to determine computedStyles for elements , I think.
This caused an error
ERROR TypeError: "getWindow(...) is null"
which occurs in this file
after running moveStart method.
I can't seem to find others who've encountered the same issue and wonder if I'm missing something or if there may be another tool that will allow me to do something like the following:
Give me the range within this Document/document-fragment Object that contains the text that starts X characters in (not including HTML tags etc, just plain text) and ends Y characters in.
It looks to me that Rangy could accomplish this using the textModules moveStart and moveEnd methods.. if they'd only work on DocumentObjects and not require access to the window.
If I've got something wrong, or if this doesn't quite constitute an issue, my apologies! not sure where else to ask the question
Would love to hear any suggestions
Thanks!
The text was updated successfully, but these errors were encountered: