Multiline comments are trimmed too aggressively #85
ChristianKienle posted onGitHub
Description We are currently adopting vuese in our component library. So far it works pretty well – thank you for this wonderful project.
Some of our components are a bit more complex – for those components we have written guides using plain markdown (for example, our table component comes with such a guide) which explain step by step how this component works. In addition to those guide we also have API documentation generated by using @vuese/parser. Sometimes we also want to include short examples in the API documentation that show how to use the component. Just to avoid developers going back and forth between the guides and API documentation too much. The example below shows such an example:
<script>
// Use this component together wit `fd-table-fixed` and `fd-table` in order to create a table with a fixed column.
// Example:
// ```xml
// <fd-table-fixed-wrapper>
// <fd-table-fixed>
// <fd-table />
// </fd-table-fixed>
// </fd-table-fixed-wrapper>
// ```
export default {
name: "FdTableFixedWrapper"
};
</script>
Our own renderer uses the component description array produces by vuese/parser, joins it using \n
and then feeds it into our markdown-component that also does syntax highlighting.
Unfortunately every line in the component description array is trimmed which means that the intention of our example code is gone making it hard to read.
<img width="982" alt="Screenshot 2019-07-05 at 15 34 54" src="https://user-images.githubusercontent.com/153225/60725888-76b4f100-9f3a-11e9-8294-36804fe8e59c.png">
To Reproduce Steps to reproduce the behavior:
- copy the example above and
- paste it into vuese explorer
Expected behavior I expect that multiline comments are not trimmed from both sides.
Screenshots See above
Which version do you use: latest as of this moment
Additional information I suggest either making the trimming lest aggressive (at least for multiline comments) or add the untrimmed comments as an additional property: "rawCommentDescription" or something like that. This way we could simply use that.
Fund this Issue
Rewarded pull request
Click to copy link
Recent activities