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:
Marshall Bowers 2024-06-12 15:53:05 -04:00 committed by GitHub
parent c3df9b79c6
commit 6fa347dff7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 741 additions and 720 deletions

View file

@ -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())