mirror of
https://github.com/heyman/heynote.git
synced 2025-06-27 21:12:00 +02:00
Fix issue with highlighting matched string in the buffer selector
broke in f1d74bb14f9ce38cb7627a3a8778f1f4009d0c18
This commit is contained in:
parent
ea16ff0c73
commit
487c274e23
@ -7,6 +7,15 @@
|
||||
|
||||
const pathSep = window.heynote.buffer.pathSeparator
|
||||
|
||||
function escapeHTML(str) {
|
||||
return str
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
}
|
||||
|
||||
export default {
|
||||
props: {
|
||||
headline: String,
|
||||
@ -106,8 +115,8 @@
|
||||
this.items = Object.entries(this.buffers).map(([path, metadata]) => {
|
||||
return {
|
||||
"path": path,
|
||||
"name": metadata?.name || path,
|
||||
"folder": path.split(pathSep).slice(0, -1).join(pathSep),
|
||||
"name": escapeHTML(metadata?.name || path),
|
||||
"folder": escapeHTML(path.split(pathSep).slice(0, -1).join(pathSep)),
|
||||
"scratch": path === SCRATCH_FILE_NAME,
|
||||
}
|
||||
})
|
||||
@ -263,8 +272,8 @@
|
||||
@click="selectItem(item)"
|
||||
ref="item"
|
||||
>
|
||||
<span class="name">{{ item.name }}</span>
|
||||
<span class="path">{{ item.folder }}</span>
|
||||
<span class="name" v-html="item.name" />
|
||||
<span class="path" v-html="item.folder" />
|
||||
<span :class="{'action-buttons':true, 'visible':actionButton > 0 && idx === selected}">
|
||||
<button
|
||||
v-if="actionButton > 0 && idx === selected"
|
||||
|
Loading…
x
Reference in New Issue
Block a user