Skip to content

Whitespace around folder and corpus name in elements filtering

ml bonhomme requested to merge whitespace-thing into master

closes #1161 (closed)

To fix this particular whitespace issue, I started doing what I had done for other missing whitespace issues, i.e. just trying to add spaces somewhere they would be taken into account.

          <template v-if="process.element">
            <span class="is-capitalized" :title="process.element.type">{{ truncateShort(typeName(process.element.type)) }}</span>
            <router-link :to="{ name: 'element-details', params: { id: process.element.id } }">
              <span class="has-text-weight-bold" :title="process.element.name">{{ truncateShort(process.element.name) }}</span>
            </router-link>
            <template v-if="corpus.id">of project</template>
          </template>

and indeed doing <template v-if="corpus.id"> of project </template> worked, but the only way I could find to add a whitespace between Folder and the folder's name was to do

<span> </span> <span class="has-text-weight-bold" :title="process.element.name">{{ truncateShort(process.element.name) }}</span>

which is horrible. So I turned to StackOverflow and read a bunch of doc (confusing, because here https://github.com/vuejs/vue/tree/dev/packages/vue-template-compiler#options it lies and says the whitespace compilerOption defaults to preserve but here https://vuejs.org/api/options-rendering.html#compileroptions it says it defaults to condense, which is true) and tried adding this bit

    config
      .module
      .rule('vue')
      .use('vue-loader')
      .loader('vue-loader')
      .tap(options => {
        options.compilerOptions = { whitespace: 'preserve' }
        return options
      })

in vue.config.js and it works. And obviously I couldn't check every single frontend component and view but I don't think it breaks anything? I think it just restores the behavior we had before.

Merge request reports

Loading