Minor fixes in xit and markdown definitions.

Minor fix in text wrap.
Chat UI now displays Google Gemini error messages.
This commit is contained in:
Martín Lucas Golini
2025-04-06 23:41:35 -03:00
parent 4895f4815c
commit 2d62165657
9 changed files with 36 additions and 35 deletions

View File

@@ -5,11 +5,9 @@ namespace EE { namespace UI { namespace Doc { namespace Language {
void addXit() {
auto dynSyntax = []( const SyntaxPattern&, const std::string_view& match ) -> std::string {
std::string lang = String::toLower( std::string{ match.substr( 3 ) } );
String::trimInPlace( lang );
if ( !lang.empty() && lang[lang.size() - 1] == '\n' )
lang.pop_back();
return SyntaxDefinitionManager::instance()->findFromString( lang ).getLanguageName();
return SyntaxDefinitionManager::instance()
->findFromString( String::trim( match.substr( 3 ) ) )
.getLanguageName();
};
SyntaxDefinitionManager::instance()->add(
@@ -17,7 +15,7 @@ void addXit() {
{ "[x]it!",
{ "%.xit$" },
{
{ { "```[%w%s+-#]+", "```" }, "function", dynSyntax },
{ { "```[%w \t%+%-#]+", "```" }, "function", dynSyntax },
{ { "%f[^%s%(]%-%>%s%d%d%d%d%-%d%d%-%d%d%f[\n%s%!%?%)]" }, "number" },
{ { "%f[^%s%(]%-%>%s%d%d%d%d%/%d%d%/%d%d%f[\n%s%!%?%)]" }, "number" },
{ { "%f[^%s%(]%-%>%s%d%d%d%d%-[wWqQ]?%d%d?%f[\n%s%!%?%)]" }, "number" },