improve(UX) make \r\n default suffix default suffix and ignore \r instead of new line
This commit is contained in:
parent
8d52ff6690
commit
94ae6e44ef
|
@ -138,6 +138,7 @@ function u8toHexdump(buffer: Uint8Array) {
|
||||||
function strToHTML(str: string) {
|
function strToHTML(str: string) {
|
||||||
return str.replace(/\n/g, '<br>') // Replace newline with <br> tag
|
return str.replace(/\n/g, '<br>') // Replace newline with <br> tag
|
||||||
.replace(/\t/g, ' ') // Replace tab with spaces (or you could use ' ' for single spaces)
|
.replace(/\t/g, ' ') // Replace tab with spaces (or you could use ' ' for single spaces)
|
||||||
|
.replace(/\r/, '')
|
||||||
.replace(/ /g, ' ');
|
.replace(/ /g, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,8 +426,8 @@ export const useDataViewerStore = defineStore('text-viewer', () => {
|
||||||
const forceToBottom = ref(true);
|
const forceToBottom = ref(true);
|
||||||
const filterChanged = ref(false);
|
const filterChanged = ref(false);
|
||||||
|
|
||||||
const textSuffixValue = ref("")
|
|
||||||
const textPrefixValue = ref("")
|
const textPrefixValue = ref("")
|
||||||
|
const textSuffixValue = ref("\\r\\n")
|
||||||
|
|
||||||
const uartBaud = ref(115200);
|
const uartBaud = ref(115200);
|
||||||
const uartBaudReal = ref(115200);
|
const uartBaudReal = ref(115200);
|
||||||
|
@ -455,28 +456,6 @@ export const useDataViewerStore = defineStore('text-viewer', () => {
|
||||||
return encoder.encode(str);
|
return encoder.encode(str);
|
||||||
})
|
})
|
||||||
|
|
||||||
// debouncedWatch(() => frameBreakSequence.value, (newValue) => {
|
|
||||||
// const unescapedStr = unescapeString(newValue);
|
|
||||||
// const encoder = new TextEncoder();
|
|
||||||
// frameBreakSequenceNormalized.value = encoder.encode(unescapedStr);
|
|
||||||
// }, {debounce: 300, immediate: true});
|
|
||||||
//
|
|
||||||
// debouncedWatch(() => frameBreakDelay.value, (newValue) => {
|
|
||||||
// if (newValue < 0) {
|
|
||||||
// frameBreakReady = false;
|
|
||||||
// clearTimeout(frameBreakTimeoutID);
|
|
||||||
// } else if (newValue === 0) {
|
|
||||||
// frameBreakReady = true;
|
|
||||||
// clearTimeout(frameBreakTimeoutID);
|
|
||||||
// } else {
|
|
||||||
// refreshTimeout();
|
|
||||||
// }
|
|
||||||
// }, {debounce: 300, immediate: true});
|
|
||||||
|
|
||||||
// let frameBreakReady = false;
|
|
||||||
// let frameBreakTimeoutID = setTimeout(() => {
|
|
||||||
// }, 0);
|
|
||||||
|
|
||||||
const dataArchive: IDataArchive[] = [];
|
const dataArchive: IDataArchive[] = [];
|
||||||
const dataBuf: IDataBuf[] = [];
|
const dataBuf: IDataBuf[] = [];
|
||||||
const dataBufLength = ref(0);
|
const dataBufLength = ref(0);
|
||||||
|
|
Loading…
Reference in New Issue