0

I am attempting to link from my wiki to web documentation within the source repository. This functionality I think is provided by using "export" links, e.g.

[export:path/to/file/index.html]

(after setting [browser] render_unsafe_content = yes)

However, when I do this I get the following browser error:

This page contains the following errors:

error on line 17 at column 10: Opening and ending tag mismatch: link line 0 and head
Below is a rendering of the page up to the first error.

(followed by a small snippet of the html page I'm trying to display).

I'm using trac v 1.1. (see also this related question: How to link to html file in Trac)

UPDATE: It seems using export does work with other html files, specifically, there's no problem with an xhtml document starting:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

but I am seeing issues with a (valid) html5 document starting:

<!DOCTYPE html>
<html lang="en">
  <head>

which I think trac is attempting to parse as xml and then failing.

Community
  • 1
  • 1
waferthin
  • 1,582
  • 1
  • 16
  • 27
  • Sorry, do you mean *link* in terms of hyperlink, or do you mean that you want to output the HTML document from within the wiki? – Ian Clark May 29 '14 at 14:41
  • I mean link in terms of hyperlink. At present, rather than displaying the linked html document in the browser, I get the above rendering error. – waferthin May 29 '14 at 15:13
  • It sounds like your HTML document is malformed. You should validate your HTML. Have you tried another document? – RjOllos May 29 '14 at 15:28
  • That was my first thought, but the document validates as HTML5 http://validator.w3.org/check and I get validation issues using other html documents. It seems like it might be interpreting it as XML somehow? – waferthin May 29 '14 at 15:38
  • The above error message is what is displayed in chrome. In firefox, I get "XML Parsing Error: mismatched tag. Expected: ....", but the linked html document starts " ..." – waferthin May 29 '14 at 15:42

1 Answers1

0

To create a hyperlink to a file within your repository you can simply use the following wiki syntax:

[browser:<path> <label>]

Where path is the path to the file within your repository and label is the text to be displayed for the link.

Ian Clark
  • 9,237
  • 4
  • 32
  • 49
  • This method seems to show the html source in a code window, rather than rendering the html page in the browser. – waferthin May 29 '14 at 15:51
  • Oh, so you want to link *directly* to the file, rather than to the browser page containing it? – Ian Clark May 29 '14 at 16:11
  • @RjOllos's comment is probably correct then, Trac may be trying to parse your document as XHTML (despite the HTML5 doctype) and therefore not liking it. If this is the case, then perhaps you'll need to specify the absolute URL to your SVN repo. – Ian Clark May 29 '14 at 16:14
  • Ah OK. Actually we're using a git repo, so I'm not sure its possible to specify an absolute link? – waferthin May 29 '14 at 16:23
  • I'm not sure how it works in the case of git I'm afraid. Again RjOllls is probably you're man to question for ini settings to just output the file. I thought that render unsure would have done it. – Ian Clark May 29 '14 at 21:46