mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-16 02:47:31 +00:00
feat(developer): handle empty outputfilename removed; processXmlValue: handled inputString.replaced_character === undefined
This commit is contained in:
parent
e3f9d3992b
commit
6ccc6cc930
2 changed files with 6 additions and 6 deletions
|
|
@ -140,7 +140,7 @@ export class KeylayoutToKmnConverter {
|
|||
const outputKmn = kmnFileWriter.write(processedData);
|
||||
const result: ConverterToKmnResult = {
|
||||
artifacts: {
|
||||
kmn: { data: outputKmn, filename: processedData?.kmnFilename ?? 'noFileName' }
|
||||
kmn: { data: outputKmn, filename: processedData?.kmnFilename ?? '' }
|
||||
}
|
||||
};
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ export class UnicodeCharacterConversion {
|
|||
public static re_dec = /^&#([0-9]{1,7});$/;
|
||||
|
||||
// &#x followed by 1.-6. hex digits or &# followed by 1.-7. decimal digits
|
||||
private static re_hexdec = /^&#(?:x[0-9a-f]{1,6}|[0-9]{1,7});/i
|
||||
private static re_hexdec = /^&#(?:x[0-9a-f]{1,6}|[0-9]{1,7});/i;
|
||||
|
||||
/**
|
||||
* @brief function to convert a (character or) numeric html character reference to a character
|
||||
|
|
@ -168,12 +168,12 @@ export class UnicodeCharacterConversion {
|
|||
inputString.replaced_character = returnChar;
|
||||
|
||||
// create a string; if if one character of the string converts to 'undefined' we set the whole string to 'undefined'
|
||||
if (inputString.replaced_character) {
|
||||
inputString.replaced_string = inputString.replaced_string + inputString.replaced_character;
|
||||
}
|
||||
else {
|
||||
if (inputString.replaced_character === undefined) {
|
||||
inputString.replaced_string = undefined;
|
||||
}
|
||||
else if (inputString.replaced_string !== undefined) {
|
||||
inputString.replaced_string = inputString.replaced_string + inputString.replaced_character;
|
||||
}
|
||||
}
|
||||
// use the rest of the string after the replaced portion and use carryOver if available
|
||||
inputString.input = inputString.carryOver + inputString.input.substring(replace_len);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue