diff options
| author | Fuwn <[email protected]> | 2024-06-19 07:37:57 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-19 07:38:02 +0000 |
| commit | ad1ae6079cf2ab7b384262f3a77100cfbf4fb5aa (patch) | |
| tree | 69e7405bf5139d0cabd6e2ef890328b0d4cb9bde /src | |
| parent | fix(ast): preserve newline structure at end of gemtext (diff) | |
| download | germ-ad1ae6079cf2ab7b384262f3a77100cfbf4fb5aa.tar.xz germ-ad1ae6079cf2ab7b384262f3a77100cfbf4fb5aa.zip | |
refactor(Node): rename content() to to_gemtext()
This commit adds a `tests/node.rs` file to test `Node::to_gemtext`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ast/node.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ast/node.rs b/src/ast/node.rs index 1040d2b..95190d2 100644 --- a/src/ast/node.rs +++ b/src/ast/node.rs @@ -173,9 +173,9 @@ pub enum Node { } impl Node { - /// Obtain the Gemtext content of a single [`Node`] as a [`String`] + /// Convert a single [`Node`] of any node type to a Gemtext [`String`] #[must_use] - pub fn content(&self) -> String { + pub fn to_gemtext(&self) -> String { super::Ast::from_nodes(vec![self.to_owned()]).to_gemtext() } } |