Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ansifilter for openSUSE:Factory checked in at 2026-10-27 17:06:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ansifilter (Old) and /work/SRC/openSUSE:Factory/.ansifilter.new.2252680 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ansifilter" Tue Oct 27 17:06:49 2026 rev:19 rq:1393010 version:2.24 Changes: -------- --- /work/SRC/openSUSE:Factory/ansifilter/ansifilter.changes 2026-08-21 16:58:04.531083160 +0200 +++ /work/SRC/openSUSE:Factory/.ansifilter.new.2252680/ansifilter.changes 2026-10-27 17:07:42.730594880 +0100 @@ -1,0 +2,9 @@ +Sat Oct 24 14:03:00 UTC 2026 - Andrea Manzini <[email protected]> + +- Update to version 2.24: + * fix OSC parsing of hyperlinks + (https://gitlab.com/saalen/ansifilter/-/work_items/47) + * refactor code to use C++17 features + * make CMP0167 policy optional in CMakeLists.txt + +------------------------------------------------------------------- Old: ---- ansifilter-2.23.tar.bz2 ansifilter-2.23.tar.bz2.asc New: ---- ansifilter-2.24.tar.bz2 ansifilter-2.24.tar.bz2.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ansifilter.spec ++++++ --- /var/tmp/diff_new_pack.Coh31z/_old 2026-10-27 17:07:44.636674720 +0100 +++ /var/tmp/diff_new_pack.Coh31z/_new 2026-10-27 17:07:44.639674846 +0100 @@ -19,11 +19,10 @@ Name: ansifilter -Version: 2.23 +Version: 2.24 Release: 0 Summary: ANSI Terminal Escape Code Converter License: GPL-3.0-or-later -Group: Development/Tools/Other URL: http://www.andre-simon.de/ Source: http://www.andre-simon.de/zip/ansifilter-%{version}.tar.bz2 Source2: http://www.andre-simon.de/zip/ansifilter-%{version}.tar.bz2.asc @@ -47,7 +46,6 @@ %package gui Summary: ANSI Terminal Escape Code Converter - Qt GUI -Group: Development/Tools/Other Requires: %{name} = %{version} %description gui ++++++ ansifilter-2.23.tar.bz2 -> ansifilter-2.24.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/CMakeLists.txt new/ansifilter-2.24/CMakeLists.txt --- old/ansifilter-2.23/CMakeLists.txt 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/CMakeLists.txt 2026-09-30 14:34:41.000000000 +0200 @@ -7,7 +7,9 @@ cmake_minimum_required(VERSION 3.10) -cmake_policy(SET CMP0167 NEW) +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) +endif() project(ansifilter-all) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/ChangeLog.adoc new/ansifilter-2.24/ChangeLog.adoc --- old/ansifilter-2.23/ChangeLog.adoc 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/ChangeLog.adoc 2026-09-30 14:34:41.000000000 +0200 @@ -1,5 +1,12 @@ = Ansifilter ChangeLog +=== ansifilter 2.24 + +30.09.2026 + + - fix OSC parsing of hyperlinks (https://gitlab.com/saalen/ansifilter/-/work_items/47) + - refactored some code to use C++17 features + === ansifilter 2.23 15.08.2026 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/bbcodegenerator.cpp new/ansifilter-2.24/src/bbcodegenerator.cpp --- old/ansifilter-2.23/src/bbcodegenerator.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/bbcodegenerator.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -84,12 +84,16 @@ } //[url=https://www.bbcode.org/]This be bbcode.org![/url] -string BBCodeGenerator::getHyperlink(std::string_view uri, std::string_view txt){ +string BBCodeGenerator::getHyperlinkOpen(std::string_view uri){ ostringstream os; - os <<"[url="<<uri<<"]"<<txt<<"[/url]"; + os <<"[url="<<uri<<"]"; return os.str(); } +string BBCodeGenerator::getHyperlinkClose(std::string_view /*uri*/){ + return "[/url]"; +} + string BBCodeGenerator::getHeader() { return ""; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/bbcodegenerator.h new/ansifilter-2.24/src/bbcodegenerator.h --- old/ansifilter-2.23/src/bbcodegenerator.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/bbcodegenerator.h 2026-09-30 14:34:41.000000000 +0200 @@ -75,7 +75,8 @@ /** \return escaped character*/ virtual string maskCharacter(unsigned char ); - virtual string getHyperlink(std::string_view uri, std::string_view txt); + virtual string getHyperlinkOpen(std::string_view uri); + virtual string getHyperlinkClose(std::string_view uri); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/cmdlineoptions.cpp new/ansifilter-2.24/src/cmdlineoptions.cpp --- old/ansifilter-2.23/src/cmdlineoptions.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/cmdlineoptions.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -283,8 +283,8 @@ case 'x': { StringTools::str2num<off_t> ( maxFileSize, arg, std::dec ); switch (arg[arg.size()-1]) { - case 'G': maxFileSize *= 1024; - case 'M': maxFileSize *= 1024; + case 'G': maxFileSize *= 1024; [[fallthrough]]; + case 'M': maxFileSize *= 1024; [[fallthrough]]; case 'K': maxFileSize *= 1024; } break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/codegenerator.cpp new/ansifilter-2.24/src/codegenerator.cpp --- old/ansifilter-2.23/src/codegenerator.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/codegenerator.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -31,6 +31,7 @@ #include <unistd.h> #endif +#include <algorithm> #include <cstdlib> #include <cstring> #include <fstream> @@ -1072,6 +1073,9 @@ size_t plainTxtCnt=0; bool tagOpen=false; + bool hyperlinkOpen=false; + string hyperlinkUri; + bool isGrepOutput=false; bool isKSeq=false; @@ -1207,6 +1211,10 @@ // restore a unicode sequence if the two digit CSI is not matched // ansiweather -l Berlin,DE | ansifilter -T if (cur==0xc2 || cur==0x1b) { + if (!tagOpen && !elementStyle.isReset()) { + lineBuf << getOpenTag(); + tagOpen = true; + } lineBuf << maskCharacter(cur); ++plainTxtCnt; } @@ -1223,19 +1231,46 @@ } // https://iterm2.com/documentation-escape-codes.html + // OSC8 hyperlinks are handled as separate open/close events (rather than + // extracting the whole link text as one raw block) so that ANSI sequences + // nested inside the link text (e.g. \e[1m..\e[22m) are still processed by + // the normal character loop below instead of being emitted unprocessed. if (next==0x5d) { - if (line[i+2]=='8') { + if (line.length() - i > 3 && line[i+2]=='8' && line[i+3]==';') { size_t uriBegin = line.find(';', i+4); - seqEnd = line.find("\x1b]8;;\x07", i); - size_t uriDelim = line.find(0x07, uriBegin+1); + // the terminator is either the modern ST (ESC \) or the legacy BEL (0x07); + // take whichever occurs first + size_t stDelim = (uriBegin != string::npos) ? line.find("\x1b\\", uriBegin+1) : string::npos; + size_t belDelim = (uriBegin != string::npos) ? line.find(0x07, uriBegin+1) : string::npos; + size_t uriDelim = std::min(stDelim, belDelim); + size_t delimLen = (uriDelim == stDelim) ? 2 : 1; - if (uriBegin != string::npos && seqEnd != string::npos){ + if (uriBegin != string::npos && uriDelim != string::npos){ string uri = line.substr(uriBegin+1, uriDelim - uriBegin - 1 ); - string txt = line.substr(uriDelim+1, seqEnd - uriDelim - 1); - lineBuf << getHyperlink(uri, txt); - i=seqEnd+4; + + if (uri.empty()) { + if (hyperlinkOpen) { + if (tagOpen) { + lineBuf << getCloseTag(); + tagOpen = false; + } + lineBuf << getHyperlinkClose(hyperlinkUri); + hyperlinkOpen = false; + hyperlinkUri.clear(); + } + } else { + if (tagOpen) { + lineBuf << getCloseTag(); + tagOpen = false; + } + lineBuf << getHyperlinkOpen(uri); + hyperlinkOpen = true; + hyperlinkUri = uri; + } + i = uriDelim+delimLen; + continue; } } ++i; @@ -1328,12 +1363,20 @@ if (seqEnd<line.length() ) { i=seqEnd+1; } else { + if (!tagOpen && !elementStyle.isReset()) { + lineBuf << getOpenTag(); + tagOpen = true; + } lineBuf << maskCharacter(line[i]); ++i; ++plainTxtCnt; } } else { // output printable character + if (!tagOpen && !elementStyle.isReset()) { + lineBuf << getOpenTag(); + tagOpen = true; + } lineBuf << maskCharacter(line[i]); ++i; ++plainTxtCnt; @@ -1347,6 +1390,10 @@ *out <<getCloseTag(); } + if (hyperlinkOpen) { + *out <<getHyperlinkClose(hyperlinkUri); + } + if (parseCP437){ printTermBuffer(); } @@ -1408,8 +1455,6 @@ return std::string(colorString.data()); } -const unsigned char CodeGenerator::valuerange[] = { 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF }; - unsigned char CodeGenerator::defaultPalette[16][3] = { { 0x00, 0x00, 0x00 }, // 0 ColorBlack { 0xCD, 0x00, 0x00 }, // 1 ColorRed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/codegenerator.h new/ansifilter-2.24/src/codegenerator.h --- old/ansifilter-2.23/src/codegenerator.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/codegenerator.h 2026-09-30 14:34:41.000000000 +0200 @@ -352,11 +352,16 @@ virtual string maskCP437Character(unsigned char c) { return maskCharacter(c); } /** \param uri URI - * \param txt Description - \return returns link formatting sequence */ - virtual string getHyperlink(std::string_view uri, std::string_view txt) { + \return returns link opening formatting sequence, emitted before the link text */ + virtual string getHyperlinkOpen(std::string_view /*uri*/) { + return ""; + } + + /** \param uri URI + \return returns link closing formatting sequence, emitted after the link text */ + virtual string getHyperlinkClose(std::string_view uri) { ostringstream os; - os << txt << "[" << uri << "]"; + os << "[" << uri << "]"; return os.str(); } @@ -535,7 +540,7 @@ bool streamIsTundra(); /// the 6 value iterations in the xterm color cube - static const unsigned char valuerange[] ; + static inline const unsigned char valuerange[] = { 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF }; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/elementstyle.cpp new/ansifilter-2.24/src/elementstyle.cpp --- old/ansifilter-2.23/src/elementstyle.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/elementstyle.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -29,7 +29,7 @@ ElementStyle::ElementStyle() : bold(false), italic(false), underline(false), blink(false), - reset(true), isNegativeMode(false), conceal(false), bgColorSet(false), fgColorSet(false), + reset(true), isNegativeMode(false), conceal(false), fgColID(0), bgColID(-1) {} @@ -58,19 +58,19 @@ } bool ElementStyle::isBgColorSet() const { - return bgColorSet; + return bgColour.has_value(); } bool ElementStyle::isFgColorSet() const { - return fgColorSet; + return fgColour.has_value(); } const StyleColour ElementStyle::getFgColour() const { - return fgColour; + return fgColour.value_or(StyleColour()); } const StyleColour ElementStyle::getBgColour() const { - return bgColour; + return bgColour.value_or(StyleColour()); } void ElementStyle::imageMode(bool negative) @@ -87,10 +87,11 @@ { reset=b; if (reset) { - setFgColour("#000000"); + fgColour.reset(); + bgColour.reset(); setFgColourID(0); setBgColourID(-1); - bold = italic = underline = conceal = blink = bgColorSet = fgColorSet = false; + bold = italic = underline = conceal = blink = false; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/elementstyle.h new/ansifilter-2.24/src/elementstyle.h --- old/ansifilter-2.23/src/elementstyle.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/elementstyle.h 2026-09-30 14:34:41.000000000 +0200 @@ -28,6 +28,8 @@ #include "stylecolour.h" +#include <optional> + using std::string; namespace ansifilter @@ -117,7 +119,6 @@ void setFgColour(const StyleColour& col) { fgColour = col; - fgColorSet=true; } /** Set Background colour @@ -125,23 +126,22 @@ void setBgColour(const StyleColour& col) { bgColour = col; - bgColorSet=true; } /** Set Foreground colour \param col colour of this element */ void setFgColour(const string& rgbVal) { - fgColour.setRGB(rgbVal); - fgColorSet=true; + if (!fgColour) fgColour = StyleColour(); + fgColour->setRGB(rgbVal); } /** Set Background colour \param col colour of this element */ void setBgColour(const string& rgbVal) { - bgColour.setRGB(rgbVal); - bgColorSet=true; + if (!bgColour) bgColour = StyleColour(); + bgColour->setRGB(rgbVal); } @@ -179,12 +179,11 @@ void imageMode(bool negative=true); private: - StyleColour fgColour; - StyleColour bgColour; + std::optional<StyleColour> fgColour; + std::optional<StyleColour> bgColour; bool bold, italic, underline, blink; bool reset; bool isNegativeMode, conceal; - bool bgColorSet, fgColorSet; int fgColID; int bgColID; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/htmlgenerator.cpp new/ansifilter-2.24/src/htmlgenerator.cpp --- old/ansifilter-2.23/src/htmlgenerator.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/htmlgenerator.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -227,12 +227,16 @@ } } -string HtmlGenerator::getHyperlink(std::string_view uri, std::string_view txt){ +string HtmlGenerator::getHyperlinkOpen(std::string_view uri){ ostringstream os; - os << "<a href='" << uri << "'>" << txt << "</a>"; + os << "<a href='" << uri << "'>"; return os.str(); } +string HtmlGenerator::getHyperlinkClose(std::string_view /*uri*/){ + return "</a>"; +} + bool HtmlGenerator::printDynamicStyleFile ( const string &outPath ) { //do not overwrite @@ -486,8 +490,9 @@ {0xff, " "} }; - auto it = charMap.find(c); - return it != charMap.end() ? it->second : std::string(1, c); + if (auto it = charMap.find(c); it != charMap.end()) + return it->second; + return std::string(1, c); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/htmlgenerator.h new/ansifilter-2.24/src/htmlgenerator.h --- old/ansifilter-2.23/src/htmlgenerator.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/htmlgenerator.h 2026-09-30 14:34:41.000000000 +0200 @@ -82,7 +82,8 @@ virtual string maskCharacter(unsigned char ); virtual string maskCP437Character(unsigned char); - virtual string getHyperlink(std::string_view uri, std::string_view txt); + virtual string getHyperlinkOpen(std::string_view uri); + virtual string getHyperlinkClose(std::string_view uri); }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/latexgenerator.cpp new/ansifilter-2.24/src/latexgenerator.cpp --- old/ansifilter-2.23/src/latexgenerator.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/latexgenerator.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -73,12 +73,16 @@ return "}"; } -string LaTeXGenerator::getHyperlink(std::string_view uri, std::string_view txt){ +string LaTeXGenerator::getHyperlinkOpen(std::string_view uri){ ostringstream os; - os <<"\\href{"<<uri<<"}{"<<txt<<"}"; + os <<"\\href{"<<uri<<"}{"; return os.str(); } +string LaTeXGenerator::getHyperlinkClose(std::string_view /*uri*/){ + return "}"; +} + string LaTeXGenerator::getGeneratorComment() { ostringstream s; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/latexgenerator.h new/ansifilter-2.24/src/latexgenerator.h --- old/ansifilter-2.23/src/latexgenerator.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/latexgenerator.h 2026-09-30 14:34:41.000000000 +0200 @@ -78,7 +78,8 @@ /** \return escaped character*/ virtual string maskCharacter(unsigned char ); - virtual string getHyperlink(std::string_view uri, std::string_view txt); + virtual string getHyperlinkOpen(std::string_view uri); + virtual string getHyperlinkClose(std::string_view uri); void insertLineNumber(); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/main.cpp new/ansifilter-2.24/src/main.cpp --- old/ansifilter-2.23/src/main.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/main.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -182,8 +182,7 @@ generator->setDefaultForegroundColor(); } - string mapPath = options.getMapPath(); - if (!generator->setColorMap(mapPath)){ + if (string mapPath = options.getMapPath(); !generator->setColorMap(mapPath)) { std::cerr <<"could not read map file: " << StringTools::sanitizeForTerminal(mapPath) << "\n"; return EXIT_FAILURE; } @@ -218,14 +217,13 @@ unsigned int fileCount=inFileList.size(), i=0; string::size_type pos=0; string inFileName, outFilePath; - string mapPath = options.getMapPath(); bool failure=false; if (!options.omitDefaultForegroundColor()) { generator->setDefaultForegroundColor(); } - if (!generator->setColorMap(mapPath)){ + if (string mapPath = options.getMapPath(); !generator->setColorMap(mapPath)) { std::cerr <<"could not read map file: " << StringTools::sanitizeForTerminal(mapPath) << "\n"; return EXIT_FAILURE; } @@ -242,7 +240,7 @@ outFilePath = options.getSingleOutFilename(); } - if ( inFileList[i].size() && Platform::fileSize(inFileList[i]) > options.getMaxFileSize() ) { + if (auto size = Platform::fileSize(inFileList[i]); inFileList[i].size() && size > static_cast<std::uintmax_t>(options.getMaxFileSize())) { std::cerr <<"file exceeds max size (see --max-size): " << StringTools::sanitizeForTerminal(inFileList[i]) << "\n"; return EXIT_FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/platform_fs.cpp new/ansifilter-2.24/src/platform_fs.cpp --- old/ansifilter-2.23/src/platform_fs.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/platform_fs.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -24,7 +24,7 @@ #include "platform_fs.h" -#include <sys/stat.h> +#include <filesystem> namespace Platform { @@ -35,15 +35,12 @@ const char pathSeparator = '/'; #endif -//-D_FILE_OFFSET_BITS=64 //268435456 256 MB -off_t fileSize(const std::string& fName) { - struct stat fileInfo; - if(stat(fName.c_str(), &fileInfo) != 0) { - return 0; - } - return fileInfo.st_size; +std::uintmax_t fileSize(const std::string& fName) { + std::error_code ec; + auto size = std::filesystem::file_size(fName, ec); + return ec ? 0 : size; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/platform_fs.h new/ansifilter-2.24/src/platform_fs.h --- old/ansifilter-2.23/src/platform_fs.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/platform_fs.h 2026-09-30 14:34:41.000000000 +0200 @@ -24,6 +24,7 @@ #ifndef PLATFORM_FS__H__INCLUDED #define PLATFORM_FS__H__INCLUDED +#include <cstdint> #include <string> @@ -31,6 +32,6 @@ { extern const char pathSeparator; -off_t fileSize(const std::string& fName); +std::uintmax_t fileSize(const std::string& fName); } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/preformatter.cpp new/ansifilter-2.24/src/preformatter.cpp --- old/ansifilter-2.23/src/preformatter.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/preformatter.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -33,10 +33,6 @@ namespace ansifilter { -const std::string PreFormatter::LB_CHARS = " \t[](){}-+<>.:,;"; -const std::string PreFormatter::WS_CHARS = " \n\r\t"; -const std::string PreFormatter::INDENT_MARKERS = "{(="; - PreFormatter::PreFormatter() : maxLineLength ( 80 ), index ( 0 ), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/preformatter.h new/ansifilter-2.24/src/preformatter.h --- old/ansifilter-2.23/src/preformatter.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/preformatter.h 2026-09-30 14:34:41.000000000 +0200 @@ -145,9 +145,9 @@ std::set<int> wrappedLines; - static const std::string LB_CHARS; - static const std::string WS_CHARS; - static const std::string INDENT_MARKERS; + static inline const std::string LB_CHARS = " \t[](){}-+<>.:,;"; + static inline const std::string WS_CHARS = " \n\r\t"; + static inline const std::string INDENT_MARKERS = "{(="; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/rtfgenerator.cpp new/ansifilter-2.24/src/rtfgenerator.cpp --- old/ansifilter-2.23/src/rtfgenerator.cpp 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/rtfgenerator.cpp 2026-09-30 14:34:41.000000000 +0200 @@ -99,12 +99,16 @@ /* '{{\\field{\\*\\fldinst HYPERLINK "'..token..'" }{\\fldrslt\\ul\\ulc0 '..token..'}}}' */ -string RtfGenerator::getHyperlink(std::string_view uri, std::string_view txt){ +string RtfGenerator::getHyperlinkOpen(std::string_view uri){ ostringstream os; - os <<R"({{\field{\*\fldinst HYPERLINK ")"<<uri<<R"(" }{\fldrslt\ul\ulc0 )"<<txt<<"}}}"; + os <<R"({{\field{\*\fldinst HYPERLINK ")"<<uri<<R"(" }{\fldrslt\ul\ulc0 )"; return os.str(); } +string RtfGenerator::getHyperlinkClose(std::string_view /*uri*/){ + return "}}}"; +} + string RtfGenerator::getHeader() { return {}; @@ -372,8 +376,7 @@ } // Find in map - auto it = charMap.find(c); - if (it != charMap.end()) { + if (auto it = charMap.find(c); it != charMap.end()) { return unicodeFromHTML(it->second); } @@ -408,8 +411,7 @@ {0xfe, "\\u9583?"}, {0xff, "\\u2588?"} }; - auto specialIt = specialMap.find(c); - if (specialIt != specialMap.end()) { + if (auto specialIt = specialMap.find(c); specialIt != specialMap.end()) { return specialIt->second; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/rtfgenerator.h new/ansifilter-2.24/src/rtfgenerator.h --- old/ansifilter-2.23/src/rtfgenerator.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/rtfgenerator.h 2026-09-30 14:34:41.000000000 +0200 @@ -110,7 +110,8 @@ /** \return escaped character*/ virtual string maskCP437Character(unsigned char ); - virtual string getHyperlink(std::string_view uri, std::string_view txt); + virtual string getHyperlinkOpen(std::string_view uri); + virtual string getHyperlinkClose(std::string_view uri); /**\return text formatting attributes in RTF format */ string getAttributes( const StyleColour & col); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ansifilter-2.23/src/version.h new/ansifilter-2.24/src/version.h --- old/ansifilter-2.23/src/version.h 2026-08-15 18:57:39.000000000 +0200 +++ new/ansifilter-2.24/src/version.h 2026-09-30 14:34:41.000000000 +0200 @@ -27,7 +27,7 @@ #include <string> -#define ANSIFILTER_VERSION "2.23" +#define ANSIFILTER_VERSION "2.24" #define ANSIFILTER_URL "http://andre-simon.de/" #define ANSIFILTER_EMAIL "[email protected]"
