[PR #58] [MERGED] Add font highlighting for ArticleView #75

Closed
opened 2026-03-14 12:30:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/hackernews-TUI/pull/58
Author: @aome510
Created: 12/22/2021
Status: Merged
Merged: 12/23/2021
Merged by: @aome510

Base: mainHead: add-article-view-font-highlight


📝 Commits (10+)

  • 06e2c86 update dependencies
  • a86cd75 move the article parser logic to client module
  • 431f494 remove toggle_markdown_mode shortcut
  • 0495c02 fix lifetime compile error in get_article
  • c008661 use article_view::get_article_view to construct the view
  • 52431e0 implement a first-iteration of Article::parse function
  • e29a0d4 handle italic/bold
  • c48c96e implement content parser for a HTML article
  • 5f912fd render an aticle view with title an padding
  • 31d47b9 handle relative links in article, label links in articles starting with 1

📊 Changes

11 files changed (+621 additions, -344 deletions)

View changed files

📝 Cargo.lock (+273 -21)
📝 examples/hn-tui.toml (+3 -17)
📝 hackernews_tui/Cargo.toml (+6 -4)
📝 hackernews_tui/src/client/mod.rs (+28 -1)
📝 hackernews_tui/src/client/parser.rs (+270 -88)
📝 hackernews_tui/src/config/keybindings.rs (+0 -4)
📝 hackernews_tui/src/config/mod.rs (+1 -1)
📝 hackernews_tui/src/config/theme.rs (+6 -2)
📝 hackernews_tui/src/view/article_view.rs (+30 -166)
📝 hackernews_tui/src/view/async_view.rs (+4 -36)
📝 hackernews_tui/src/view/help_view.rs (+0 -4)

📄 Description

Brief description of changes

  • implement a parser (font highlighting) for parsing article's content (in HTML) into styled text
  • add left-right paddings for ArticleView
  • label link IDs in ArticleView to start with 1
  • move Article struct from view module to client module
  • upgrade dependencies, replace htmlescape with html-escape
  • add html5ever and markup5ever_rcdom for parsing HTML document
  • rename functions/variables, simplify comment parsing function
  • add header, bold component styles

Breaking changes

  • require the article's content received from article_parse_command to be in HTML format
  • change the default article_parse_command to mercury-parser without additional arguments
  • remove toggle_raw_markdown_mode command

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aome510/hackernews-TUI/pull/58 **Author:** [@aome510](https://github.com/aome510) **Created:** 12/22/2021 **Status:** ✅ Merged **Merged:** 12/23/2021 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `main` ← **Head:** `add-article-view-font-highlight` --- ### 📝 Commits (10+) - [`06e2c86`](https://github.com/aome510/hackernews-TUI/commit/06e2c869175b1e866b5c7c267cd22b186a77d252) update dependencies - [`a86cd75`](https://github.com/aome510/hackernews-TUI/commit/a86cd75c3011abab6b4e5fa143b77196d5ad119b) move the article parser logic to `client` module - [`431f494`](https://github.com/aome510/hackernews-TUI/commit/431f494f8e0d0f3ffb04b60e76caf2a6e9f7a15d) remove `toggle_markdown_mode` shortcut - [`0495c02`](https://github.com/aome510/hackernews-TUI/commit/0495c0284b39639ad849681220e61a2d7d3970c6) fix lifetime compile error in `get_article` - [`c008661`](https://github.com/aome510/hackernews-TUI/commit/c008661119d2f9555249f19f02bcf2efe492b8dd) use `article_view::get_article_view` to construct the view - [`52431e0`](https://github.com/aome510/hackernews-TUI/commit/52431e0af15fe6193ed4d74e0b487199edc79144) implement a first-iteration of `Article::parse` function - [`e29a0d4`](https://github.com/aome510/hackernews-TUI/commit/e29a0d44ac7ab22540c486c159f830079504bc83) handle italic/bold - [`c48c96e`](https://github.com/aome510/hackernews-TUI/commit/c48c96e7944dec8b9d67a4acf4eb15739abff343) implement content parser for a HTML article - [`5f912fd`](https://github.com/aome510/hackernews-TUI/commit/5f912fd773ecc960fbfc1a25ddcbccd25dcb8a8f) render an aticle view with title an padding - [`31d47b9`](https://github.com/aome510/hackernews-TUI/commit/31d47b9f90b9f235a234557030000e4bf16aed79) handle relative links in article, label links in articles starting with `1` ### 📊 Changes **11 files changed** (+621 additions, -344 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+273 -21) 📝 `examples/hn-tui.toml` (+3 -17) 📝 `hackernews_tui/Cargo.toml` (+6 -4) 📝 `hackernews_tui/src/client/mod.rs` (+28 -1) 📝 `hackernews_tui/src/client/parser.rs` (+270 -88) 📝 `hackernews_tui/src/config/keybindings.rs` (+0 -4) 📝 `hackernews_tui/src/config/mod.rs` (+1 -1) 📝 `hackernews_tui/src/config/theme.rs` (+6 -2) 📝 `hackernews_tui/src/view/article_view.rs` (+30 -166) 📝 `hackernews_tui/src/view/async_view.rs` (+4 -36) 📝 `hackernews_tui/src/view/help_view.rs` (+0 -4) </details> ### 📄 Description ## Brief description of changes - implement a parser (font highlighting) for parsing article's content (in HTML) into styled text - add left-right paddings for `ArticleView` - label link IDs in `ArticleView` to start with 1 - move `Article` struct from `view` module to `client` module - upgrade dependencies, replace `htmlescape` with `html-escape` - add `html5ever` and `markup5ever_rcdom` for parsing HTML document - rename functions/variables, simplify comment parsing function - add `header`, `bold` component styles ## Breaking changes - require the article's content received from `article_parse_command` to be in HTML format - change the default `article_parse_command` to `mercury-parser` without additional arguments - remove `toggle_raw_markdown_mode` command --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 12:30:56 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hackernews-TUI#75
No description provided.