Closed hehonghui closed 1 year ago
@odrobnik any suggestion for this ?
I would insert an invisible character and give it an attribute, probably a link attribute with only with the #anchor. This can then be found when you want to scroll to it.
I would insert an invisible character and give it an attribute, probably a link attribute with only with the #anchor. This can then be found when you want to scroll to it.
If we insert a invisible character, the attributed string will be changed. I found anthor way to do that, if parse a tag which has anchor id and it's content is empty, i store the id and text range location into a dictionay. When i need the anchor, i take it from the dictionary.
but where do you put the dictionary? In an attributed string an attribute cannot have an empty range, it has to have at least one character. So I would probably add the anchor on the next non-empty range following.
I create a dictionary property in html builder. This sulotuon works for me. "add the anchor on the next non-empty range following." That's a better way to do this. 🍺
Hi, Cocoanetics team, thank you for this awesome project.
I have a problem, in some html pages there are some empty a tags without content for anchor positioning, when the user clicks this anchor point can jump to the location of this anchor point. But now DTCoreText seems to ignore this kind of anchor tags without content, if I want to implement the empty anchor tag positioning function, how should I do it?
Thank you!