我们正在Vb.Net中将HTML转换为Word文档,并希望使用跳转链接跳转到Word文档的特定部分。我为此行为使用锚标记。但是,当用户单击链接时,它总是跳到页面顶部。有人遇到过这个问题吗?
跳转链接锚标记-
<sup><a href="#popRef1">Comment1</a></sup>
目标锚标记-
<a id="popRef1">Comment 1.</a> "The above superscript doesn't get linked to me instead jumps to the top of the document!!!"</p>
这是转换后的word文档中的外观- 上标“ 1”(左侧)应与右侧脚注下的“ 1”链接。
<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body style="font-family:arial;font-size:16px;"><p style="font-size:10px;"></p><p style="color:#000080;font-weight:bold;font-size:18px;">** New Section **</p><p>The below text is used only for testing purpose and this post.</p>
<p>In <a href="https://en.wikipedia.org/wiki/Computing" title="Computing">computing</a>, a <b>hyperlink</b>, or simply a <b>link</b>, is a reference to <a href="https://en.wikipedia.org/wiki/Data_(computing)" title="Data (computing)">data</a> that the reader can follow by clicking or tapping.<sup id="cite_ref-1"><a href="https://en.wikipedia.org/wiki/Hyperlink#cite_note-1">[1]</a></sup> A hyperlink points to a whole document or to a specific element within a document. <a href="https://en.wikipedia.org/wiki/Hypertext" title="Hypertext">Hypertext</a> is text with hyperlinks. The text that is linked from is called <a href="https://en.wikipedia.org/wiki/Anchor_text" title="Anchor text">anchor text</a>. A software system that is used for viewing and creating hypertext is a <i>hypertext system</i>, and to create a hyperlink is <i>to hyperlink</i> (or simply <i>to link</i>). A user following hyperlinks is said to <i>navigate</i> or <i>browse</i> the hypertext. <sup><a href="#popnoteRef1">1</a></sup> <a contenteditable="false" data-track-changes-ignore="ignore" onclick="doPopup(this);"><object><p>This informarion is all used just for testing and this example -</p>
<p>The syntax and appearance of wikilinks may vary. <a href="https://en.wikipedia.org/wiki/Ward_Cunningham" title="Ward Cunningham">Ward Cunningham</a>'s original <a href="https://en.wikipedia.org/wiki/Wiki_software" title="Wiki software">wiki software</a>, the <a href="https://en.wikipedia.org/wiki/WikiWikiWeb" title="WikiWikiWeb">WikiWikiWeb</a> used <a href="https://en.wikipedia.org/wiki/CamelCase" title="CamelCase">CamelCase</a> for this purpose. CamelCase was also used in the early version of <a href="https://en.wikipedia.org/wiki/Wikipedia" title="Wikipedia">Wikipedia</a> and is still used in some wikis, such as <a href="https://en.wikipedia.org/wiki/TiddlyWiki" title="TiddlyWiki">TiddlyWiki</a>, <a href="https://en.wikipedia.org/wiki/Trac" title="Trac">Trac</a>, and <a href="https://en.wikipedia.org/wiki/PmWiki" title="PmWiki">PmWiki</a>. A common markup syntax is the use of double square brackets around the term to be wikilinked. For example, the input "[[zebras]]" is converted by wiki software using this markup syntax to a link to a <a href="https://en.wikipedia.org/wiki/Zebras" title="Zebras">zebras</a> article. Hyperlinks used in wikis are commonly classified as follows:</p>
<ul>
<li><b>Internal wikilinks</b> or <b>intrawiki links</b> lead to pages within the same wiki website.</li>
<li><b><a href="https://en.wikipedia.org/wiki/Interwiki_links" title="Interwiki links">Interwiki links</a></b> are simplified markup hyperlinks that lead to pages of other wikis that are associated with the first.</li>
<li><b>External links</b> lead to other webpages (those not covered in the above two cases, wiki or not wiki).</li>
</ul>
</object></a></p>
<p>The document containing a hyperlink is known as its source document. For example, in an online reference work such as <a href="https://en.wikipedia.org/wiki/Wikipedia" title="Wikipedia">Wikipedia</a>, or <a href="https://en.wikipedia.org/wiki/Google" title="Google">Google</a>, many words and terms in the text are hyperlinked to definitions of those terms. Hyperlinks are often used to implement reference <a href="https://en.wikipedia.org/wiki/Mechanism_(engineering)" title="Mechanism (engineering)">mechanisms</a> such as tables of contents, <a href="https://en.wikipedia.org/wiki/Footnotes" title="Footnotes">footnotes</a>, <a href="https://en.wikipedia.org/wiki/Bibliographies" title="Bibliographies">bibliographies</a>, <a href="https://en.wikipedia.org/wiki/Index_(publishing)" title="Index (publishing)">indexes</a>, <a href="https://en.wikipedia.org/wiki/Letter_(message)" title="Letter (message)">letters</a> and <a href="https://en.wikipedia.org/wiki/Glossaries" title="Glossaries">glossaries</a>. <sup><a href="#popnoteRef2">2</a></sup> </p>
<p>In some hypertext hyperlinks can be bidirectional: they can be followed in two directions, so both ends act as <a href="https://en.wikipedia.org/wiki/HTML_element#Anchor" title="HTML element">anchors</a> and as targets. More complex arrangements exist, such as many-to-many links.</p>
<p>The effect of following a hyperlink may vary with the hypertext system and may sometimes depend on the link itself; for instance, on the <a href="https://en.wikipedia.org/wiki/World_Wide_Web" title="World Wide Web">World Wide Web</a> most hyperlinks cause the target document to replace the document being displayed, but some are marked to cause the target document to open in a new window. Another possibility is <a href="https://en.wikipedia.org/wiki/Transclusion" title="Transclusion">transclusion</a>, for which the link target is a document <a href="https://en.wiktionary.org/wiki/fragment" title="wikt:fragment">fragment</a> that replaces the link anchor within the source document. Not only persons browsing the document follow hyperlinks. These hyperlinks may also be followed automatically by programs. A program that traverses the hypertext, following each hyperlink and gathering all the retrieved documents is known as a Web <i>spider</i> or <a href="https://en.wikipedia.org/wiki/Web_crawler" title="Web crawler">crawler</a>.</p>
<hr /><p style="font-weight:bold;"> </p><p style="font-weight:bold;">Footnotes </p><br /><a id="popnoteRef1">1.</a> This informarion is all used just for testing and this example -</p>
<p>The syntax and appearance of wikilinks may vary. <a href="https://en.wikipedia.org/wiki/Ward_Cunningham" title="Ward Cunningham">Ward Cunningham</a>'s original <a href="https://en.wikipedia.org/wiki/Wiki_software" title="Wiki software">wiki software</a>, the <a href="https://en.wikipedia.org/wiki/WikiWikiWeb" title="WikiWikiWeb">WikiWikiWeb</a> used <a href="https://en.wikipedia.org/wiki/CamelCase" title="CamelCase">CamelCase</a> for this purpose. CamelCase was also used in the early version of <a href="https://en.wikipedia.org/wiki/Wikipedia" title="Wikipedia">Wikipedia</a> and is still used in some wikis, such as <a href="https://en.wikipedia.org/wiki/TiddlyWiki" title="TiddlyWiki">TiddlyWiki</a>, <a href="https://en.wikipedia.org/wiki/Trac" title="Trac">Trac</a>, and <a href="https://en.wikipedia.org/wiki/PmWiki" title="PmWiki">PmWiki</a>. A common markup syntax is the use of double square brackets around the term to be wikilinked. For example, the input "[[zebras]]" is converted by wiki software using this markup syntax to a link to a <a href="https://en.wikipedia.org/wiki/Zebras" title="Zebras">zebras</a> article. Hyperlinks used in wikis are commonly classified as follows:</p>
<ul>
<li><b>Internal wikilinks</b> or <b>intrawiki links</b> lead to pages within the same wiki website.</li>
<li><b><a href="https://en.wikipedia.org/wiki/Interwiki_links" title="Interwiki links">Interwiki links</a></b> are simplified markup hyperlinks that lead to pages of other wikis that are associated with the first.</li>
<li><b>External links</b> lead to other webpages (those not covered in the above two cases, wiki or not wiki).</li>
</ul>
<br /><a id="popnoteRef2">2.</a> This information is all used just for testing and this example -</p>
<p>The syntax and appearance of wikilinks may vary. <a href="https://en.wikipedia.org/wiki/Ward_Cunningham" title="Ward Cunningham">Ward Cunningham</a>'s original <a href="https://en.wikipedia.org/wiki/Wiki_software" title="Wiki software">wiki software</a>, the <a href="https://en.wikipedia.org/wiki/WikiWikiWeb" title="WikiWikiWeb">WikiWikiWeb</a> used <a href="https://en.wikipedia.org/wiki/CamelCase" title="CamelCase">CamelCase</a> for this purpose. CamelCase was also used in the early version of <a href="https://en.wikipedia.org/wiki/Wikipedia" title="Wikipedia">Wikipedia</a> and is still used in some wikis, such as <a href="https://en.wikipedia.org/wiki/TiddlyWiki" title="TiddlyWiki">TiddlyWiki</a>, <a href="https://en.wikipedia.org/wiki/Trac" title="Trac">Trac</a>, and <a href="https://en.wikipedia.org/wiki/PmWiki" title="PmWiki">PmWiki</a>. A common markup syntax is the use of double square brackets around the term to be wikilinked. For example, the input "[[zebras]]" is converted by wiki software using this markup syntax to a link to a <a href="https://en.wikipedia.org/wiki/Zebras" title="Zebras">zebras</a> article. Hyperlinks used in wikis are commonly classified as follows:</p>
<ul>
<li><b>Internal wikilinks</b> or <b>intrawiki links</b> lead to pages within the same wiki website.</li>
<li><b><a href="https://en.wikipedia.org/wiki/Interwiki_links" title="Interwiki links">Interwiki links</a></b> are simplified markup hyperlinks that lead to pages of other wikis that are associated with the first.</li>
<li><b>External links</b> lead to other webpages (those not covered in the above two cases, wiki or not wiki).</li>
</ul>
<br /></body></html>