Move rustdoc-related code to rustdoc
crate (#12945)
This PR moves the rustdoc-related code out of `html_to_markdown` and into the `rustdoc` crate. Release Notes: - N/A
This commit is contained in:
parent
c3df9b79c6
commit
6fa347dff7
16 changed files with 741 additions and 720 deletions
|
@ -23,11 +23,19 @@ fn inline_elements() -> &'static HashSet<&'static str> {
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct HtmlElement {
|
||||
pub(crate) tag: String,
|
||||
tag: String,
|
||||
pub(crate) attrs: RefCell<Vec<Attribute>>,
|
||||
}
|
||||
|
||||
impl HtmlElement {
|
||||
pub fn new(tag: String, attrs: RefCell<Vec<Attribute>>) -> Self {
|
||||
Self { tag, attrs }
|
||||
}
|
||||
|
||||
pub fn tag(&self) -> &str {
|
||||
&self.tag
|
||||
}
|
||||
|
||||
/// Returns whether this [`HtmlElement`] is an inline element.
|
||||
pub fn is_inline(&self) -> bool {
|
||||
inline_elements().contains(self.tag.as_str())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue