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( @@ -161,7 +161,7 @@ Glib::ustring Reader::make(
continue;
}
// Header
// Quote
Glib::ustring quote;
if (Line::Match::quote(line, quote))
@ -177,10 +177,11 @@ Glib::ustring Reader::make( @@ -177,10 +177,11 @@ Glib::ustring Reader::make(
// @TODO other tags..
// Default
pango.append(
line.append(
"\n"
) // @TODO
Make::plain(
line
)
);
}
@ -261,6 +262,17 @@ Glib::ustring Reader::Make::link( @@ -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(
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 @@ -52,6 +52,10 @@ namespace app::browser::main::tab::page::content::text::gemini
const Glib::ustring & ALT
);
static Glib::ustring plain(
const Glib::ustring & TEXT
);
static Glib::ustring quote(
const Glib::ustring & TEXT
);

Loading…
Cancel
Save