Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: hyperlink support. #665

Merged
merged 4 commits into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update README
  • Loading branch information
ArthurSonzogni committed Jun 4, 2023
commit b5b32fb0a3c80cb8715503fa66d5fb363f210b5a
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ An element can be decorated using the functions:
- `strikethrough`
- `color`
- `bgcolor`
- `hyperlink`

[Example](https://arthursonzogni.github.io/FTXUI/examples_2dom_2style_gallery_8cpp-example.html)

Expand Down
4 changes: 2 additions & 2 deletions src/ftxui/dom/hyperlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Hyperlink : public NodeDecorator {
};

/// @brief Make the rendered area clickable using a web browser.
/// The link will be opened when the user click on the element.
/// The link will be opened when the user click on it.
/// This is supported only on a limited set of terminal emulator.
/// List: https://github.com/Alhadis/OSC8-Adoption/
/// @param link The link
Expand All @@ -48,7 +48,7 @@ Element hyperlink(std::string link, Element child) {
}

/// @brief Decorate using an hyperlink.
/// The link will be opened when the user click on the element.
/// The link will be opened when the user click on it.
/// This is supported only on a limited set of terminal emulator.
/// List: https://github.com/Alhadis/OSC8-Adoption/
/// @param link The link to redirect the users to.
Expand Down
4 changes: 1 addition & 3 deletions src/ftxui/dom/hyperlink_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "ftxui/dom/node.hpp" // for Render
#include "ftxui/screen/screen.hpp" // for Screen, Pixel

// NOLINTBEGIN
namespace ftxui {

TEST(HyperlinkTest, Basic) {
Expand Down Expand Up @@ -38,8 +37,7 @@ TEST(HyperlinkTest, Basic) {
}

} // namespace ftxui
// NOLINTEND

// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Copyright 2023 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.