Make searching just more robust, by making it a lot dumber

This commit is contained in:
2025-10-13 15:19:14 +01:00
parent ce95d7bcaf
commit 6ce8f6dbdc
3 changed files with 13 additions and 5 deletions

View File

@@ -35,6 +35,8 @@ export interface Register {
description: string;
issue_4_only: boolean;
source: string[];
search: string;
wiki_link: string;
text: string;
notes: Note[];
}
@@ -94,6 +96,8 @@ export function processRegisterBlock(paragraph: string, registers: Register[]) {
modes: [],
issue_4_only: false,
source: [],
search: "",
wiki_link: "",
text: "",
notes: [],
};

View File

@@ -8,11 +8,13 @@ export const parseDescriptionDefault = (reg: Register, description: string) => {
const detail: RegisterDetail = { read: undefined, write: undefined, common: undefined, text: ''};
for (const line of descriptionLines) {
if (line.includes('Issue 4 Only')) reg.issue_4_only = true;
const spaces_at_start = line.match(/^(\s*)/)?.[0].length || 0;
const trimmedLine = line.trim();
reg.source.push(line);
reg.search += line + " ";
const trimmedLine = line.trim();
const spaces_at_start = line.match(/^(\s*)/)?.[0].length || 0;
if (line.includes('Issue 4 Only')) reg.issue_4_only = true;
if (trimmedLine.startsWith('//')) continue;

View File

@@ -17,8 +17,10 @@ export const parseDescriptionF0 = (reg: Register, description: string) => {
for (const line of descriptionLines) {
reg.source.push(line);
const spaces_at_start = line.match(/^(\s*)/)?.[0].length || 0;
reg.search += line + " ";
const trimmedLine = line.trim();
const spaces_at_start = line.match(/^(\s*)/)?.[0].length || 0;
if(spaces_at_start == 2) {
if (trimmedLine.startsWith('*')) {