-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from gosub-browser/doctype-fixes
Implemented doctype nodes
- Loading branch information
Showing
7 changed files
with
146 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod comment; | ||
pub mod doctype; | ||
pub mod document; | ||
pub mod element; | ||
pub mod text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use core::fmt::{Debug, Formatter}; | ||
use std::fmt; | ||
|
||
#[derive(PartialEq, Clone)] | ||
/// Data structure for document nodes | ||
pub struct DocTypeData { | ||
pub name: String, | ||
pub pub_identifier: String, | ||
pub sys_identifier: String, | ||
} | ||
|
||
impl Default for DocTypeData { | ||
fn default() -> Self { | ||
Self::new("", "", "") | ||
} | ||
} | ||
|
||
impl Debug for DocTypeData { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { | ||
let mut debug = f.debug_struct("DocTypeData"); | ||
debug.finish() | ||
} | ||
} | ||
|
||
impl DocTypeData { | ||
pub(crate) fn new(name: &str, pub_identifier: &str, sys_identifier: &str) -> Self { | ||
DocTypeData { | ||
name: name.to_string(), | ||
pub_identifier: pub_identifier.to_string(), | ||
sys_identifier: sys_identifier.to_string(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters