[PR #56] [MERGED] [#51] add font highlight for CommentView and StoryView #72

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

📋 Pull Request Information

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

Base: mainHead: 51-add-font-highlight


📝 Commits (10+)

  • bc38992 implement font-highlighting parser for comment text
  • 48a8333 add italic component style
  • 0339092 not using substring to get the substring when parsing
  • 41976ed clean up parser code
  • ae4580b handle empty string for some regex(s)
  • b2f86c4 handle open comment link commands with link ID starts from 1
  • e21fab7 add parse rule for markdown single-line code block
  • f57a24f parse story title into a styled string
  • aff5e11 parse story's category and add component style for each category
  • 38ef107 remove regex module

📊 Changes

5 files changed (+219 additions, -144 deletions)

View changed files

📝 hackernews_tui/src/client/parser.rs (+180 -93)
📝 hackernews_tui/src/config/theme.rs (+28 -2)
📝 hackernews_tui/src/view/comment_view.rs (+6 -5)
📝 hackernews_tui/src/view/help_view.rs (+4 -2)
📝 hackernews_tui/src/view/story_view.rs (+1 -42)

📄 Description

Part 1 of #51.

Brief description of changes

  • rewrite the parser function for parsing HN comment (as HTML text)
  • add font highlighting for CommentView that adds highlight/color to
    • italic
    • quote paragraph
    • single code block surrounded by ``
    • multi-line code block
  • add font highlighting for StoryView that adds highlight/color to story's categories (Show HN, Ask HN, etc) and implement a parser for parsing story title
  • make link ID in comment text starts from 1 and change the corresponding open_link_* commands in CommentView
  • add more component styles

🔄 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/56 **Author:** [@aome510](https://github.com/aome510) **Created:** 12/17/2021 **Status:** ✅ Merged **Merged:** 12/17/2021 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `main` ← **Head:** `51-add-font-highlight` --- ### 📝 Commits (10+) - [`bc38992`](https://github.com/aome510/hackernews-TUI/commit/bc38992bc2ba28f82f544e979c589817b26dc360) implement font-highlighting parser for comment text - [`48a8333`](https://github.com/aome510/hackernews-TUI/commit/48a83330a31547a5055c3dc2f15ae862e45f5af6) add `italic` component style - [`0339092`](https://github.com/aome510/hackernews-TUI/commit/03390926f1882e3626543f665718691338f763e2) not using `substring` to get the substring when parsing - [`41976ed`](https://github.com/aome510/hackernews-TUI/commit/41976edd94dde5dcffc78eeac14042672bbc2205) clean up parser code - [`ae4580b`](https://github.com/aome510/hackernews-TUI/commit/ae4580b558f9e56615710dfce7ce30f44430ca98) handle empty string for some regex(s) - [`b2f86c4`](https://github.com/aome510/hackernews-TUI/commit/b2f86c477e39a3fed7d886d6aa0ed6a6daf8a004) handle open comment link commands with link ID starts from 1 - [`e21fab7`](https://github.com/aome510/hackernews-TUI/commit/e21fab7870c636339baa96fa113aa872f8fceaa2) add parse rule for markdown single-line code block - [`f57a24f`](https://github.com/aome510/hackernews-TUI/commit/f57a24f290f9e8fa05fb56e1db840f78b08214fe) parse story title into a styled string - [`aff5e11`](https://github.com/aome510/hackernews-TUI/commit/aff5e115e8e69ef4527d596d7bcb06a66012a073) parse story's category and add component style for each category - [`38ef107`](https://github.com/aome510/hackernews-TUI/commit/38ef107839e47240c17317412d06a08ee70093c3) remove `regex` module ### 📊 Changes **5 files changed** (+219 additions, -144 deletions) <details> <summary>View changed files</summary> 📝 `hackernews_tui/src/client/parser.rs` (+180 -93) 📝 `hackernews_tui/src/config/theme.rs` (+28 -2) 📝 `hackernews_tui/src/view/comment_view.rs` (+6 -5) 📝 `hackernews_tui/src/view/help_view.rs` (+4 -2) 📝 `hackernews_tui/src/view/story_view.rs` (+1 -42) </details> ### 📄 Description Part 1 of #51. ## Brief description of changes - rewrite the parser function for parsing HN comment (as HTML text) - add font highlighting for `CommentView` that adds highlight/color to + italic + quote paragraph + single code block surrounded by `` + multi-line code block - add font highlighting for `StoryView` that adds highlight/color to story's categories (`Show HN`, `Ask HN`, etc) and implement a parser for parsing story title - make link ID in comment text starts from `1` and change the corresponding `open_link_*` commands in `CommentView` - add more component styles --- <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:40 +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#72
No description provided.