https://github.com/threedaymonk/htmlentities
HTMLEntities is a simple library to facilitate encoding and decoding of named (ý and so on) or numerical ({ or Ī) entities in HTML and XHTML documents.
https://github.com/threedaymonk/htmlentities
Last synced: about 6 hours ago
JSON representation
Repository metadata
HTMLEntities is a simple library to facilitate encoding and decoding of named (ý and so on) or numerical ({ or Ī) entities in HTML and XHTML documents.
- Host: GitHub
- URL: https://github.com/threedaymonk/htmlentities
- Owner: threedaymonk
- License: other
- Created: 2009-06-11T16:53:24.000Z (over 16 years ago)
- Default Branch: main
- Last Pushed: 2025-11-28T16:37:02.000Z (13 days ago)
- Last Synced: 2025-12-05T14:36:45.750Z (6 days ago)
- Language: Ruby
- Homepage:
- Size: 242 KB
- Stars: 339
- Watchers: 6
- Forks: 31
- Open Issues: 7
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.txt
- License: COPYING.txt
README.md
HTMLEntities
The canonical source for this project can be found at GitHub:
threedaymonk/htmlentities.
HTML entity encoding and decoding for Ruby
HTMLEntities is a simple library to facilitate encoding and decoding of named
(ý and so on) or numerical ({ or Ī) entities in HTML
and XHTML documents.
Usage
Decoding
require 'htmlentities'
coder = HTMLEntities.new
string = "élan"
coder.decode(string) # => "élan"
Encoding
This is slightly more complicated, due to the various options. The encode
method takes a variable number of parameters, which tell it which instructions
to carry out.
require 'htmlentities'
coder = HTMLEntities.new
string = "<élan>"
Escape unsafe codepoints only:
coder.encode(string) # => "<élan>"
Or:
coder.encode(string, :basic) # => "<élan>"
Escape all entities that have names:
coder.encode(string, :named) # => "<élan>"
Escape all non-ASCII/non-safe codepoints using decimal entities:
coder.encode(string, :decimal) # => "<élan>"
As above, using hexadecimal entities:
coder.encode(string, :hexadecimal) # => "<élan>"
You can also use several options, e.g. use named entities for unsafe codepoints, then decimal for all other non-ASCII:
coder.encode(string, :basic, :decimal) # => "<élan>"
Flavours
HTMLEntities knows about three different sets of entities:
:xhtml1– Entities from the XHTML1 doctype:html4– Entities from the HTML4 doctype. Differs from +xhtml1+ only by the absence of +&apos+:expanded– Entities from a variety of SGML sets
The default is :xhtml, but you can override this:
coder = HTMLEntities.new(:expanded)
Licence
This code is free to use under the terms of the MIT licence. See the file
COPYING.txt for more details.
Contact
Send email to pbattley@gmail.com.
Owner metadata
- Name: Paul Battley
- Login: threedaymonk
- Email:
- Kind: user
- Description:
- Website: http://po-ru.com/
- Location: London
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/17347?u=759e40555756873625b01b898e91919007838fd4&v=4
- Repositories: 138
- Last ynced at: 2024-12-06T21:43:39.991Z
- Profile URL: https://github.com/threedaymonk
GitHub Events
Total
- Watch event: 5
- Delete event: 1
- Issue comment event: 1
- Push event: 3
- Fork event: 1
Last Year
- Watch event: 5
- Delete event: 1
- Issue comment event: 1
- Push event: 3
- Fork event: 1
Committers metadata
Last synced: 7 days ago
Total Commits: 145
Total Committers: 8
Avg Commits per committer: 18.125
Development Distribution Score (DDS): 0.048
Commits in past year: 27
Committers in past year: 3
Avg Commits per committer in past year: 9.0
Development Distribution Score (DDS) in past year: 0.074
| Name | Commits | |
|---|---|---|
| Paul Battley | p****y@g****m | 138 |
| Stephan Kaag | s****g@m****m | 1 |
| Ryunosuke SATO | t****s@g****m | 1 |
| Junya Ishihara | j****a@c****m | 1 |
| John Merrells | j****n@m****m | 1 |
| Jan Andersson | j****n@g****m | 1 |
| Yulia Chepurna | y****a@t****m | 1 |
| Jan Andersson | j****n@m****m | 1 |
Committer domains:
- mynewsdesk.com: 1
- thinkdataworks.com: 1
- merrells.com: 1
- champierre.com: 1
- moneybird.com: 1
Issue and Pull Request metadata
Last synced: 12 days ago
Total issues: 31
Total pull requests: 8
Average time to close issues: 2 months
Average time to close pull requests: over 2 years
Total issue authors: 29
Total pull request authors: 7
Average comments per issue: 3.03
Average comments per pull request: 2.75
Merged pull request: 1
Bot issues: 0
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 1
Past year average time to close issues: about 16 hours
Past year average time to close pull requests: 1 day
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 2.0
Past year average comments per pull request: 4.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- amomchilov (2)
- nathany (2)
- Mandaryn (1)
- yondaimeorg (1)
- joshminnie (1)
- denegny (1)
- gucki (1)
- Cahl-Dee (1)
- doconnor-clintel (1)
- shedd (1)
- ckruse (1)
- mslinn (1)
- Timberjaw (1)
- ydakuka (1)
- andrewhavens (1)
Top Pull Request Authors
- janne (2)
- stephanmoneybird (1)
- nholden (1)
- amomchilov (1)
- yulia-che (1)
- Jerska (1)
- tricknotes (1)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 3
-
Total downloads:
- rubygems: 426,950,341 total
- Total docker downloads: 1,383,199,268
- Total dependent packages: 412 (may contain duplicates)
- Total dependent repositories: 15,981 (may contain duplicates)
- Total versions: 52
- Total maintainers: 1
gem.coop: htmlentities
A module for encoding and decoding (X)HTML entities.
- Homepage: https://github.com/threedaymonk/htmlentities
- Documentation: http://www.rubydoc.info/gems/htmlentities/
- Licenses: MIT
- Latest release: 4.4.2 (published 22 days ago)
- Last Synced: 2025-12-09T17:01:59.778Z (2 days ago)
- Versions: 17
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 213,467,461 Total
- Docker Downloads: 691,599,634
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.038%
- Downloads: 0.113%
- Maintainers (1)
rubygems.org: htmlentities
A module for encoding and decoding (X)HTML entities.
- Homepage: https://github.com/threedaymonk/htmlentities
- Documentation: http://www.rubydoc.info/gems/htmlentities/
- Licenses: MIT
- Latest release: 4.4.2 (published 22 days ago)
- Last Synced: 2025-12-09T19:05:12.249Z (2 days ago)
- Versions: 17
- Dependent Packages: 412
- Dependent Repositories: 15,981
- Downloads: 213,482,880 Total
- Docker Downloads: 691,599,634
-
Rankings:
- Dependent packages count: 0.11%
- Downloads: 0.112%
- Docker downloads count: 0.17%
- Dependent repos count: 0.28%
- Average: 1.176%
- Stargazers count: 3.104%
- Forks count: 3.28%
- Maintainers (1)
proxy.golang.org: github.com/threedaymonk/htmlentities
- Homepage:
- Documentation: https://pkg.go.dev/github.com/threedaymonk/htmlentities#section-documentation
- Licenses: other
- Latest release: v4.4.1+incompatible (published 23 days ago)
- Last Synced: 2025-12-09T19:05:13.357Z (2 days ago)
- Versions: 18
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 3.057%
- Forks count: 3.099%
- Average: 6.624%
- Dependent packages count: 9.56%
- Dependent repos count: 10.779%
Dependencies
- rake >= 12.3.3 development
- rspec ~> 3 development
- actions/checkout v5 composite
- ruby/setup-ruby v1 composite
Score: 29.242565243878285