escape path segments with escapeStringHTML()

This commit is contained in:
joshuaboud 2022-05-25 16:40:58 -03:00
parent 8bd30b1d1f
commit d3d16bf903
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E

View File

@ -7,7 +7,9 @@
<button <button
@click.prevent.stop="$emit('cd', `/${pathArr.slice(1, index + 1).join('/')}`)" @click.prevent.stop="$emit('cd', `/${pathArr.slice(1, index + 1).join('/')}`)"
class="p-2 hover:bg-accent rounded-lg cursor-pointer" class="p-2 hover:bg-accent rounded-lg cursor-pointer"
>{{ segment }}</button> v-html="escapeStringHTML(segment)"
:title="escapeString(`/${pathArr.slice(1, index + 1).join('/')}`)"
></button>
</template> </template>
</div> </div>
</div> </div>
@ -17,6 +19,7 @@
import { ref, watch, nextTick } from 'vue'; import { ref, watch, nextTick } from 'vue';
import { canonicalPath } from "@45drives/cockpit-helpers"; import { canonicalPath } from "@45drives/cockpit-helpers";
import { ChevronRightIcon } from '@heroicons/vue/solid'; import { ChevronRightIcon } from '@heroicons/vue/solid';
import { escapeString, escapeStringHTML } from '../functions/escapeStringHTML';
export default { export default {
props: { props: {
@ -53,6 +56,8 @@ export default {
inputRef, inputRef,
changeCallback, changeCallback,
canonicalPath, canonicalPath,
escapeString,
escapeStringHTML,
} }
}, },
components: { components: {