Nested hyperlinks don't underline properly

  • If I have one hyperlink inside of another (yes I need to do this), the underlining stops at the first end tag of the same type it finds rather than the actual matching end tag.

    For example:
    [a]one [a]two[/a] three[/a]

    It gets underlined as:
    one two three

    rather than:
    one two three

    It is as if once it finds an opening hyperlink TextObject, it searches for any ending hyperlink TextObject instead of using the endTag property of the opening hyperlink TextObject to find the actual end, or comparing the one it finds to be sure it matches the endtag property of the first one.

    This also occurs with WpTools v5, so it is nothing new.

    If you don't have time to fix this, or feel you don't want to support nested hyperlinks, can you at least point me where in the code it determines what it needs to underline on a hyperlink so I can at least try to get it to underline properly? I'm desperate for a solution.

    Thanks,
    Eric

    • Offizieller Beitrag

    Hi,

    nested Hyperlinks are in fact not supported and, if nesting is required, it should be possible to use fields and Bookmarks instead.

    The underline or other attributes are located by the function in TParagraph par.AGetBaseAndSpan. Extending that to look for nested tags would mnake it necessary to check all characters up to the start of the document.

    Julian

  • Thanks, I'll take a look.

    A bit of history. We use both hyperlinks and bookmarking already to nest things. We use Bookmarking to mark blocks of text that will be linked to other parts of a report, such as for an auto summary. We also use hyperlinks for in-line, wysiwyg active checkboxes, picklists and cloakable text. Cloakable text is so they can show/hide parts of a report with a click, and picklist to select from a drop down (need wysiwyg for this as well).

    So basically I had to overload the hyperlink object by embedding the type of hyperlink in the object. This all works great. However, many want to put picklists and active checkboxes inside of cloakable text. Both are hyperlinks, but it works well except for the colorization, i.e. underlining.

    Since the cloakable text underlining stops at the end of the picklist or checkbox, the user doesn't know visually that the remaining text after the picklist or checkbox is also cloaked.

    So it is confusing to me why the text that follows the picklist is not underlined since it is not even nested at that point, but is part of a hyperlink.

    While nested hyperlinks do work, the colorization does not. It is a little late to change cloakable text to use something other than the hyperlink tags, but I could build a reformatter to change just cloakable text from a hyperlink to something else, but not sure if that is the way to go at this point.

    Eric