How do I preserve style when rendering Markdown documents via the HTTP API #6802

Closed
opened 2025-11-02 07:06:56 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @a96219 on GitHub (Feb 3, 2021).

HTML documents returned via interface API /v1/markdown do not contain styles. Is there a way to return the same style asreadme. mddocument preview

Originally created by @a96219 on GitHub (Feb 3, 2021). HTML documents returned via interface `API /v1/markdown` do not contain styles. Is there a way to return the same style as` readme. md `document preview
GiteaMirror added the type/question label 2025-11-02 07:06:56 -06:00
Author
Owner

@a96219 commented on GitHub (Feb 3, 2021):

parameter

{
  "Text": "---\r\ngitea: none\r\ninclude_toc: true\r\n---\r\n## 测试文档\r\n|版本|日期|修订者|变更描述|\r\n|---|----|-----|--------|\r\n|machineid|测试编号|String||Y|测试说明\r\n|typeid|测试类型|int||Y|测试应用",
  "Wiki": true
}

The return value

<details><summary>Table of Contents</summary><ul>
<li>
<a href="#user-content-%E6%B5%8B%E8%AF%95%E6%96%87%E6%A1%A3" rel="nofollow">测试文档</a></li>
</ul>
</details><h2 id="user-content-测试文档">测试文档</h2>
<table>
<thead>
<tr>
<th>版本</th>
<th>日期</th>
<th>修订者</th>
<th>变更描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>machineid</td>
<td>测试编号</td>
<td>String</td>
<td></td>
</tr>
<tr>
<td>typeid</td>
<td>测试类型</td>
<td>int</td>
<td></td>
</tr>
</tbody>
</table>
@a96219 commented on GitHub (Feb 3, 2021): parameter ```json { "Text": "---\r\ngitea: none\r\ninclude_toc: true\r\n---\r\n## 测试文档\r\n|版本|日期|修订者|变更描述|\r\n|---|----|-----|--------|\r\n|machineid|测试编号|String||Y|测试说明\r\n|typeid|测试类型|int||Y|测试应用", "Wiki": true } ``` The return value ```html <details><summary>Table of Contents</summary><ul> <li> <a href="#user-content-%E6%B5%8B%E8%AF%95%E6%96%87%E6%A1%A3" rel="nofollow">测试文档</a></li> </ul> </details><h2 id="user-content-测试文档">测试文档</h2> <table> <thead> <tr> <th>版本</th> <th>日期</th> <th>修订者</th> <th>变更描述</th> </tr> </thead> <tbody> <tr> <td>machineid</td> <td>测试编号</td> <td>String</td> <td></td> </tr> <tr> <td>typeid</td> <td>测试类型</td> <td>int</td> <td></td> </tr> </tbody> </table> ```
Author
Owner

@zeripath commented on GitHub (Feb 9, 2021):

I'm afraid not. This is deliberate. The point is that the associated page places it in a rendering context - this is only supposed to be a fragment.

@zeripath commented on GitHub (Feb 9, 2021): I'm afraid not. This is deliberate. The point is that the associated page places it in a rendering context - this is only supposed to be a fragment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6802