Hyperlink from Footnote Up does not work

hi there,

i am using this codes below to replace text with html. All works, but the hyperlink in the footnote when clicked cannot go to the right place- it pass over the section that should be - up to the first document; but if click from up link go to the footnote link, it is okay, not the other way around.

I attach the picture and also document output to see that click from footnote ‘hola’ to 'context; does not work, but from ‘context’ to ‘hola’ works.

asposeme_image.docx (233.9 KB)
context link:


footnote link:

private class ReplaceWithHtmlEvaluator : IReplacingCallback
{
    public string SomeData { get; set; }
    internal ReplaceWithHtmlEvaluator(FindReplaceOptions options)
    {
        mOptions = options;
    }

    //This simplistic method will only work well when the match starts at the beginning of a run. 
    ReplaceAction IReplacingCallback.Replacing(ReplacingArgs args)
    {
        DocumentBuilder builder = new DocumentBuilder((Document)args.MatchNode.Document);
        builder.MoveTo(args.MatchNode);

        // Replace '<CustomerName>' text with a red bold name.
        // builder.InsertHtml("<b><font color='red'>James Bond, </font></b>"); args.Replacement = "";
        builder.InsertHtml(SomeData); 
        args.Replacement = "";

        return ReplaceAction.Replace;
    }

    private readonly FindReplaceOptions mOptions;
}

regards and thanks

@ibox If take a look at the “footnotes”, you can see that they points to bookmarks. For example the first one:
{ HYPERLINK \l "footnote_84859030211710992444596" }
but the bookmark footnote_84859030211710992444596 wraps the footnote, so the hyperlink points to the same paragraph where the hyperlink is located. MS Word in this case moves cursor to the beginning of the document.

To make this work there should be two bookmarks for each pair of context and footnotes links. Content link should point to the bookmark located at the footnote and footnote link should point to the bookmark located at the context.

Thank you Sir,

But why the tiny editor works for both ways?
So, what to do to make it work in MS-Word too?

regards

@ibox Could you please provide you input HTML here for our reference? Unfortunately, I am not familiar with tiny editor, so it is difficult to say why it works in both ways.
You should note, Aspose.Words is designed to work with MS Word documents. HTML documents and MS Word documents object models are quite different and it is not always possible to provide 100% fidelity after conversion one format to another.

here u are, Sir.

regards
reference_sample_aspose.docx (25.7 KB)

I found they are already reference each other:

<h2><sup id=""footnote_84859030211710992444596"" class=""mce-footnote""><a href=""#footnotes_entry_84859030211710992444596"">1</a></sup>Context</h2>
<li id=""footnotes_entry_84859030211710992444596""><a class=""mce-footnotes-backlink"" href=""#footnote_84859030211710992444596"">^&nbsp;</a><span class=""mce-footnotes-note"">hola</span></li>

@ibox
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-26783

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The problem occurs because Aspose.Words does not create a bookmark for <sup> element. As a workaround, you can move the bookmark into <h2> element:

<h2 id="footnote_84859030211710992444596"><sup><a href="#footnotes_entry_84859030211710992444596">1</a></sup>Context</h2>
<li id="footnotes_entry_84859030211710992444596"><a href="#footnote_84859030211710992444596">^&nbsp;</a><span>hola</span></li>

In this case the bookmark is created and cross references works as expected.

Thank you, Sir.

So we need to modify the DOM of the html? - it is a huge task as i do not know much on the tiny editor as well-
I am now in trial version just to make sure that the capabilities we need are provided by Aspose. Once it is OKAY then my boss will buy the license, not only MS Words, but also for Excel.

regards

@ibox Yes, currently the only workaround is modifying HTML DOM. We have logged a defect WORDSNET-26783 and will investigate why bookmark is not created for a <sup> element. We will keep you updated and let you know once the issue is resolved.