Skip to content

Introduce an acts_as_loofah method#293

Open
flavorjones wants to merge 1 commit intomainfrom
flavorjones-acts-as-loofah
Open

Introduce an acts_as_loofah method#293
flavorjones wants to merge 1 commit intomainfrom
flavorjones-acts-as-loofah

Conversation

@flavorjones
Copy link
Owner

@flavorjones flavorjones commented Jan 22, 2025

Introduce an #acts_as_loofah method to make Nokogiri instances act like Loofah instances.

These classes have a new instance method, #acts_as_loofah:

  • Nokogiri::XML::Document
  • Nokogiri::XML::DocumentFragment
  • Nokogiri::HTML4::Document
  • Nokogiri::HTML4::DocumentFragment
  • Nokogiri::HTML5::Document
  • Nokogiri::HTML5::DocumentFragment

This method extends the Nokogiri object so that it quacks like the corresponding Loofah object.

Note that this method will also extend any existing child element objects, just as if those objects were created as children of a Loofah document.

Closes #13

@flavorjones flavorjones force-pushed the flavorjones-acts-as-loofah branch 3 times, most recently from 6c4fa6e to 97dc987 Compare January 22, 2025 20:05
@flavorjones flavorjones changed the title Introduce an acts_as_loofah! method Introduce an acts_as_loofah method Jan 22, 2025
@flavorjones flavorjones force-pushed the flavorjones-acts-as-loofah branch from 97dc987 to cb31664 Compare January 22, 2025 20:56
to make Nokogiri instances act like Loofah instances.

These classes have a new instance method, `#acts_as_loofah`:

- Nokogiri::XML::Document
- Nokogiri::XML::DocumentFragment
- Nokogiri::HTML4::Document
- Nokogiri::HTML4::DocumentFragment
- Nokogiri::HTML5::Document
- Nokogiri::HTML5::DocumentFragment

This method extends the Nokogiri object so that it quacks like the
corresponding Loofah object.

Note that this method will also extend any existing child element
objects, just as if those objects were created as children of a Loofah
document.
@flavorjones flavorjones force-pushed the flavorjones-acts-as-loofah branch from cb31664 to a397eda Compare January 22, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: allow Loofah-ization of an existing Nokogiri document or fragment

1 participant