Browse Source

add plain text maker

CPP-GTK4
yggverse 3 months ago
parent
commit
a372dd80bd
  1. 20
      src/app/browser/main/tab/page/content/text/gemini/reader.cpp
  2. 4
      src/app/browser/main/tab/page/content/text/gemini/reader.hpp

20
src/app/browser/main/tab/page/content/text/gemini/reader.cpp

@ -161,7 +161,7 @@ Glib::ustring Reader::make(
continue; continue;
} }
// Header // Quote
Glib::ustring quote; Glib::ustring quote;
if (Line::Match::quote(line, quote)) if (Line::Match::quote(line, quote))
@ -177,10 +177,11 @@ Glib::ustring Reader::make(
// @TODO other tags.. // @TODO other tags..
// Default
pango.append( pango.append(
line.append( Make::plain(
"\n" line
) // @TODO )
); );
} }
@ -261,6 +262,17 @@ Glib::ustring Reader::Make::link(
); );
} }
Glib::ustring Reader::Make::plain(
const Glib::ustring & TEXT
) {
return Glib::ustring::sprintf(
"%s\n",
Glib::Markup::escape_text(
TEXT
)
);
}
Glib::ustring Reader::Make::quote( Glib::ustring Reader::Make::quote(
const Glib::ustring & TEXT const Glib::ustring & TEXT
) { ) {

4
src/app/browser/main/tab/page/content/text/gemini/reader.hpp

@ -52,6 +52,10 @@ namespace app::browser::main::tab::page::content::text::gemini
const Glib::ustring & ALT const Glib::ustring & ALT
); );
static Glib::ustring plain(
const Glib::ustring & TEXT
);
static Glib::ustring quote( static Glib::ustring quote(
const Glib::ustring & TEXT const Glib::ustring & TEXT
); );

Loading…
Cancel
Save