MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / AfterLoadMarkdown

Method AfterLoadMarkdown

src/textfile_gui.cpp:487–502  ·  view source on GitHub ↗

* Post-processing of markdown files. */

Source from the content-addressed store, hash-verified

485 * Post-processing of markdown files.
486 */
487void TextfileWindow::AfterLoadMarkdown()
488{
489 for (size_t line_index = 0; line_index < this->lines.size(); ++line_index) {
490 Line &line = this->lines[line_index];
491
492 /* Find and mark all hyperlinks in the line. */
493 this->FindHyperlinksInMarkdown(line, line_index);
494
495 /* All lines beginning with # are headings. */
496 if (!line.text.empty() && line.text[0] == '#') {
497 this->jumplist.push_back(line_index);
498 this->lines[line_index].colour = TC_GOLD;
499 this->link_anchors.emplace_back(line_index, 0, 0, MakeAnchorSlug(line.text));
500 }
501 }
502}
503
504/* virtual */ void TextfileWindow::OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count)
505{

Callers 1

AfterLoadTextMethod · 0.95

Calls 5

MakeAnchorSlugFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected