JanGuillermo/vue3-markdown-it

Specify component's root DOM element instead of defaulting to a plain DIV

jasesmith opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
Yes. The root element of this component outputs a naked div tag and breaks my CSS layout controls and styles and forces me to manually wrap the component in my desired tag rather than just outputting my desired tag.

Describe the solution you'd like
I would really like to be able to specify which tag should be the root element. For instance in my implementation and layout CSS I am expecting a section tag to be the DOM node instead of a div tag.

Describe alternatives you've considered
I can wrap the component instance in my template with my desired tag, but that still leaves a naked div child node in the DOM and in some cases breaks CSS flex or grid layouts.

Additional context
Seems like this final return could use a prop like md.tag (or something with a 'div' fallback?) for the tag type instead of 'div':

return () => h('div', { innerHTML: md.value });