Only orgify the link text if there are line breaks present.
This commit is contained in:
parent
135ca133ea
commit
7cf1f7b7bb
@ -1,4 +1,5 @@
|
|||||||
[[file:simple.org]]
|
[[file:simple.org]]
|
||||||
|
[[file:sim ple.org]]
|
||||||
|
|
||||||
[[file:simp
|
[[file:simp
|
||||||
le.org]]
|
le.org]]
|
||||||
|
@ -2805,8 +2805,8 @@ fn compare_regular_link<'b, 's>(
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
EmacsField::Required(":search-option"),
|
EmacsField::Required(":search-option"),
|
||||||
|r| r.search_option,
|
|r| r.get_search_option(),
|
||||||
compare_property_quoted_string
|
compare_property_quoted_string_owned
|
||||||
)
|
)
|
||||||
)? {
|
)? {
|
||||||
this_status = new_status;
|
this_status = new_status;
|
||||||
|
@ -683,11 +683,32 @@ pub(crate) fn orgify_text<'s>(raw_text: &'s str) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'s> RegularLink<'s> {
|
impl<'s> RegularLink<'s> {
|
||||||
|
/// Orgify the raw_link if it contains line breaks.
|
||||||
pub fn get_raw_link(&self) -> String {
|
pub fn get_raw_link(&self) -> String {
|
||||||
|
if self.raw_link.contains('\n') {
|
||||||
orgify_text(self.raw_link)
|
orgify_text(self.raw_link)
|
||||||
|
} else {
|
||||||
|
self.raw_link.to_owned()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Orgify the path if it contains line breaks.
|
||||||
pub fn get_path(&self) -> String {
|
pub fn get_path(&self) -> String {
|
||||||
|
if self.path.contains('\n') {
|
||||||
orgify_text(self.path)
|
orgify_text(self.path)
|
||||||
|
} else {
|
||||||
|
self.path.to_owned()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Orgify the search_option if it contains line breaks.
|
||||||
|
pub fn get_search_option(&self) -> Option<String> {
|
||||||
|
self.search_option.map(|search_option| {
|
||||||
|
if search_option.contains('\n') {
|
||||||
|
orgify_text(search_option)
|
||||||
|
} else {
|
||||||
|
search_option.to_owned()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user