feat(links): open in new tab

This commit is contained in:
thek4n 2026-07-20 01:13:34 +03:00
parent 348dc8819d
commit 319330190a
4 changed files with 12 additions and 3 deletions

View File

@ -6,6 +6,13 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](https://semver.org/lang/en/). [Semantic Versioning](https://semver.org/lang/en/).
## `v0.6.2` - 20.07.2026
### Changed
- Links are now opens in new tab.
---
## `v0.6.1` - 17.07.2026 ## `v0.6.1` - 17.07.2026
### Added ### Added
- Add compile-time templates minificattion. - Add compile-time templates minificattion.

2
Cargo.lock generated
View File

@ -1567,7 +1567,7 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]] [[package]]
name = "mdpreview" name = "mdpreview"
version = "0.6.1" version = "0.6.2"
dependencies = [ dependencies = [
"askama", "askama",
"askama_axum", "askama_axum",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "mdpreview" name = "mdpreview"
version = "0.6.1" version = "0.6.2"
edition = "2024" edition = "2024"
authors = ["Vladislav Kan <thek4n@yandex.ru>"] authors = ["Vladislav Kan <thek4n@yandex.ru>"]
build = "build.rs" build = "build.rs"

View File

@ -435,7 +435,9 @@ fn render_blockquote(quote_kind: Option<BlockQuoteKind>) -> String {
fn render_link(link_type: LinkType, dest_url: &CowStr<'_>, title: &CowStr<'_>) -> String { fn render_link(link_type: LinkType, dest_url: &CowStr<'_>, title: &CowStr<'_>) -> String {
match link_type { match link_type {
LinkType::Email => format!("<a href=\"mailto:{dest_url}\" title=\"{title}\">"), LinkType::Email => format!("<a href=\"mailto:{dest_url}\" title=\"{title}\">"),
_ => format!("<a href=\"{dest_url}\" title=\"{title}\">"), _ => format!(
"<a href=\"{dest_url}\" title=\"{title}\" target=\"_blank\" rel=\"noopener noreferrer\">"
),
} }
} }