\r
<body>\r
<wicket:extend>\r
+<div wicket:id="doc"></div>\r
+\r
+<wicket:fragment wicket:id="markupContent">\r
+<div class="docs" style="margin-top: -10px;">\r
+ <!-- doc nav links --> \r
+ <div style="float: right;" class="docnav">\r
+ <a wicket:id="blameLink"><wicket:message key="gb.blame"></wicket:message></a> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="rawLink"><wicket:message key="gb.raw"></wicket:message></a>\r
+ </div> \r
+ \r
+ <!-- document content -->\r
+ <div class="markdown" wicket:id="content">[content]</div>\r
+</div>\r
+</wicket:fragment>\r
+\r
+<wicket:fragment wicket:id="plainContent">\r
+<div class="docs">\r
<!-- doc nav links --> \r
- <div style="float: right;" class="page_nav2">\r
+ <div style="float: right;" class="docnav">\r
<a wicket:id="blameLink"><wicket:message key="gb.blame"></wicket:message></a> | <a wicket:id="historyLink"><wicket:message key="gb.history"></wicket:message></a> | <a wicket:id="rawLink"><wicket:message key="gb.raw"></wicket:message></a>\r
</div> \r
\r
<!-- document content -->\r
- <div class="markdown" style="padding-bottom:5px;" wicket:id="content">[content]</div>\r
+ <div wicket:id="content">[content]</div>\r
+</div>\r
+</wicket:fragment>\r
+\r
</wicket:extend>\r
</body>\r
</html>
\ No newline at end of file
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
+import org.apache.wicket.markup.html.panel.Fragment;\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
\r
import com.gitblit.wicket.CacheControl.LastModified;\r
import com.gitblit.wicket.MarkupProcessor;\r
import com.gitblit.wicket.MarkupProcessor.MarkupDocument;\r
+import com.gitblit.wicket.MarkupProcessor.MarkupSyntax;\r
import com.gitblit.wicket.WicketUtils;\r
\r
@CacheControl(LastModified.BOOT)\r
}\r
}\r
\r
+ Fragment fragment;\r
+ MarkupDocument markupDoc = processor.parse(repositoryName, getBestCommitId(commit), documentPath, markupText);\r
+ if (MarkupSyntax.PLAIN.equals(markupDoc.syntax)) {\r
+ fragment = new Fragment("doc", "plainContent", this);\r
+ } else {\r
+ fragment = new Fragment("doc", "markupContent", this);\r
+ }\r
+\r
// document page links\r
- add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,\r
+ fragment.add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,\r
WicketUtils.newPathParameter(repositoryName, objectId, documentPath)));\r
- add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,\r
+ fragment.add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,\r
WicketUtils.newPathParameter(repositoryName, objectId, documentPath)));\r
- add(new BookmarkablePageLink<Void>("rawLink", RawPage.class, WicketUtils.newPathParameter(\r
+ fragment.add(new BookmarkablePageLink<Void>("rawLink", RawPage.class, WicketUtils.newPathParameter(\r
repositoryName, objectId, documentPath)));\r
\r
- MarkupDocument markupDoc = processor.parse(repositoryName, getBestCommitId(commit), documentPath, markupText);\r
- add(new Label("content", markupDoc.html).setEscapeModelStrings(false));\r
+ fragment.add(new Label("content", markupDoc.html).setEscapeModelStrings(false));\r
+ add(fragment);\r
}\r
\r
@Override\r