docs: invalid <p> for route params (#9455)

Signed-off-by: Rongrong <15956627+Rongronggg9@users.noreply.github.com>
This commit is contained in:
Rongrong
2022-04-04 20:43:45 +08:00
committed by GitHub
parent cf8cb29a14
commit 19608abd31
2 changed files with 8 additions and 6 deletions

View File

@@ -15,7 +15,8 @@
<div v-if="path.match(/(?<=:).*?(?=\/|$)/g)">
<p>
Parameters:
<ul><li class="params" v-for="(item, index) in path.match(/(?<=:).*?(?=\/|$)/g)"><code>{{item.replace('?','')}}</code>, {{(item.includes('?'))?'optional':'required'}} - <span v-html="renderMarkdown(paramsDesc[index])"></span></li></ul> </p>
</p>
<ul><li class="params" v-for="(item, index) in path.match(/(?<=:).*?(?=\/|$)/g)"><code>{{item.replace('?','')}}</code>, {{(item.includes('?'))?'optional':'required'}} - <span v-html="renderMarkdown(paramsDesc[index])"></span></li></ul>
</div>
<div v-else><p>Parameters: N/A</p></div>
<slot></slot>
@@ -66,11 +67,11 @@ export default {
},
},
methods: {
renderMarkdown(item) {
renderMarkdown(item, inline = true) {
const md = require('markdown-it')({
html: true,
});
return md.render(item);
return inline ? md.renderInline(item) : md.render(item);
},
},
computed: {