A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuejs/vue/issues/6200 below:

Add preserveWhitespace on a per-component basis · Issue #6200 · vuejs/vue · GitHub

What problem does this feature solve?

Take this component:

<template>
  <div>
    <span>Mark</span>
    <span>down</span>
  </div>
</template>

If preserveWhitespace is enabled in vue-template-compiler then this will get rendered on the page as this:

Mark down

I would have to resort to some sort of CSS to get around this, so that it instead renders as:

Markdown

What I would instead like is the ability to have preserveWhitespace enabled by default but have the ability to override this on a per-component basis. If that were an option then I could disable it for the above component and then it would render in HTML as this:

<div><span>Mark</span><span>down</span></div>
What does the proposed API look like?

I'm envisioning maybe a new top level property for the exported function within a single-file Vue component. E.g.:

export default {
  name: 'Markdown'
  preserveWhitespace: true
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4