Fossil SCM
Fix the "artifact" URL to render markdown text automatically.
Commit
60019ce7d9b8d3939a5e3e43320f48b280ab55cc
Parent
e2e8531ba76915e…
1 file changed
+3
-2
+3
-2
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1722,11 +1722,12 @@ | ||
| 1722 | 1722 | }else{ |
| 1723 | 1723 | renderAsHtml = 1; |
| 1724 | 1724 | style_submenu_element("Text", "Text", |
| 1725 | 1725 | "%s/artifact/%s?txt=1", g.zTop, zUuid); |
| 1726 | 1726 | } |
| 1727 | - }else if( fossil_strcmp(zMime, "text/x-fossil-wiki")==0 ){ | |
| 1727 | + }else if( fossil_strcmp(zMime, "text/x-fossil-wiki")==0 | |
| 1728 | + || fossil_strcmp(zMime, "text/x-markdown")==0 ){ | |
| 1728 | 1729 | if( asText ){ |
| 1729 | 1730 | style_submenu_element("Wiki", "Wiki", |
| 1730 | 1731 | "%s/artifact/%s", g.zTop, zUuid); |
| 1731 | 1732 | }else{ |
| 1732 | 1733 | renderAsWiki = 1; |
| @@ -1739,11 +1740,11 @@ | ||
| 1739 | 1740 | style_submenu_element("Parsed", "Parsed", "%R/info/%s", zUuid); |
| 1740 | 1741 | } |
| 1741 | 1742 | @ <hr /> |
| 1742 | 1743 | content_get(rid, &content); |
| 1743 | 1744 | if( renderAsWiki ){ |
| 1744 | - wiki_convert(&content, 0, 0); | |
| 1745 | + wiki_render_by_mimetype(&content, zMime); | |
| 1745 | 1746 | }else if( renderAsHtml ){ |
| 1746 | 1747 | @ <iframe src="%R/raw/%T(blob_str(&downloadName))?name=%s(zUuid)" |
| 1747 | 1748 | @ width="100%%" frameborder="0" marginwidth="0" marginheight="0" |
| 1748 | 1749 | @ sandbox="allow-same-origin" |
| 1749 | 1750 | @ onload="this.height = this.contentDocument.documentElement.scrollHeight;"> |
| 1750 | 1751 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1722,11 +1722,12 @@ | |
| 1722 | }else{ |
| 1723 | renderAsHtml = 1; |
| 1724 | style_submenu_element("Text", "Text", |
| 1725 | "%s/artifact/%s?txt=1", g.zTop, zUuid); |
| 1726 | } |
| 1727 | }else if( fossil_strcmp(zMime, "text/x-fossil-wiki")==0 ){ |
| 1728 | if( asText ){ |
| 1729 | style_submenu_element("Wiki", "Wiki", |
| 1730 | "%s/artifact/%s", g.zTop, zUuid); |
| 1731 | }else{ |
| 1732 | renderAsWiki = 1; |
| @@ -1739,11 +1740,11 @@ | |
| 1739 | style_submenu_element("Parsed", "Parsed", "%R/info/%s", zUuid); |
| 1740 | } |
| 1741 | @ <hr /> |
| 1742 | content_get(rid, &content); |
| 1743 | if( renderAsWiki ){ |
| 1744 | wiki_convert(&content, 0, 0); |
| 1745 | }else if( renderAsHtml ){ |
| 1746 | @ <iframe src="%R/raw/%T(blob_str(&downloadName))?name=%s(zUuid)" |
| 1747 | @ width="100%%" frameborder="0" marginwidth="0" marginheight="0" |
| 1748 | @ sandbox="allow-same-origin" |
| 1749 | @ onload="this.height = this.contentDocument.documentElement.scrollHeight;"> |
| 1750 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1722,11 +1722,12 @@ | |
| 1722 | }else{ |
| 1723 | renderAsHtml = 1; |
| 1724 | style_submenu_element("Text", "Text", |
| 1725 | "%s/artifact/%s?txt=1", g.zTop, zUuid); |
| 1726 | } |
| 1727 | }else if( fossil_strcmp(zMime, "text/x-fossil-wiki")==0 |
| 1728 | || fossil_strcmp(zMime, "text/x-markdown")==0 ){ |
| 1729 | if( asText ){ |
| 1730 | style_submenu_element("Wiki", "Wiki", |
| 1731 | "%s/artifact/%s", g.zTop, zUuid); |
| 1732 | }else{ |
| 1733 | renderAsWiki = 1; |
| @@ -1739,11 +1740,11 @@ | |
| 1740 | style_submenu_element("Parsed", "Parsed", "%R/info/%s", zUuid); |
| 1741 | } |
| 1742 | @ <hr /> |
| 1743 | content_get(rid, &content); |
| 1744 | if( renderAsWiki ){ |
| 1745 | wiki_render_by_mimetype(&content, zMime); |
| 1746 | }else if( renderAsHtml ){ |
| 1747 | @ <iframe src="%R/raw/%T(blob_str(&downloadName))?name=%s(zUuid)" |
| 1748 | @ width="100%%" frameborder="0" marginwidth="0" marginheight="0" |
| 1749 | @ sandbox="allow-same-origin" |
| 1750 | @ onload="this.height = this.contentDocument.documentElement.scrollHeight;"> |
| 1751 |