[#104169] [Ruby master Feature#17938] Keyword alternative for boolean positional arguments — matheusrichardt@...

Issue #17938 has been reported by matheusrich (Matheus Richard).

12 messages 2021/06/04

[#104213] [Ruby master Feature#17942] Add a `initialize(public @a, private @b)` shortcut syntax for defining public/private accessors for instance vars — tyler@...

Issue #17942 has been reported by TylerRick (Tyler Rick).

6 messages 2021/06/09

[#104288] [Ruby master Bug#17992] Upstreaming the htmlentities gem into CGI#.(un)escape_html — alexandermomchilov@...

Issue #17992 has been reported by AMomchilov (Alexander Momchilov).

9 messages 2021/06/15

[#104338] [Ruby master Misc#17997] DevelopersMeeting20210715Japan — mame@...

Issue #17997 has been reported by mame (Yusuke Endoh).

10 messages 2021/06/17

[#104361] [Ruby master Bug#18000] have_library doesn't work when ruby is compiled with --disable-shared --disable-install-static-library — jean.boussier@...

Issue #18000 has been reported by byroot (Jean Boussier).

9 messages 2021/06/18

[#104401] [Ruby master Feature#18007] Help developers of C extensions meet requirements in "doc/extension.rdoc" — mike.dalessio@...

Issue #18007 has been reported by mdalessio (Mike Dalessio).

16 messages 2021/06/25

[#104430] [Ruby master Bug#18011] `Method#parameters` is incorrect for forwarded arguments — josh.cheek@...

Issue #18011 has been reported by josh.cheek (Josh Cheek).

12 messages 2021/06/29

[ruby-core:104409] [Ruby master Feature#17992] Upstreaming the htmlentities gem into CGI#.(un)escape_html

From: alexandermomchilov@...
Date: 2021-06-25 21:08:50 UTC
List: ruby-core #104409
Issue #17992 has been updated by AMomchilov (Alexander Momchilov).


I took the first steps in incorporating this gem, starting with:

```bash
git subtree add \
     --prefix=lib/cgi/htmlentities \
     https://github.com/threedaymonk/htmlentities \
     master
```

Which puts the entire `htmlentities` repo under lib/cgi/htmlentities`. This is really nice because it preserves all the git history of the files, original authorship, etc.

* From there, I started pulling the subfolders apart, such as moving its tests from
    `lib/cgi/htmlentities/tests/*_test.rb` to `test/cgi/htmlentities/test_*.rb`.

    Here's what that process looked like:

    https://github.com/amomchilov/cgi/compare/embed-htmlentities-gem-subtree...amomchilov:integrate-htmlentities-gem?expand=1

* I also name-spaced all of its files from `HTMLEntities::*` to `CGI::HTMLEntities::*`, so that this doesn't conflict with any existing code that uses both `cgi` and `htmlentities`.

* Next I plan to add `require 'cgi/htmlentities/lib/htmlentities'" to `lib/cgi/util.rb`, and the add `#escape_html_entites` and `#unescape_html_entities` methods, which forward onto `HTMLEntities`'s methods.

How does this look so far?

FYI Here's the "full diff" between my work and CGI's master branch:

https://github.com/ruby/cgi/compare/master...amomchilov:integrate-htmlentities-gem?expand=1

----------------------------------------
Feature #17992: Upstreaming the htmlentities gem into CGI#.(un)escape_html
https://bugs.ruby-lang.org/issues/17992#change-92653

* Author: AMomchilov (Alexander Momchilov)
* Status: Feedback
* Priority: Normal
----------------------------------------
Hi there,

I was looking to unescape some HTML entities in a String, and I discovered that `CGI#.(un)escape_html` is **really** limited. Many StackOverflow questions share a similar disappointment, and point users to using the [htmlentities gem](https://github.com/threedaymonk/htmlentities):

1. https://stackoverflow.com/a/383561/3141234
2. https://stackoverflow.com/a/22926384/3141234

This solved my problem, but I feel like something this standard/universal should be built-in. To that end, I'm interested in working on merging the htmlentities gem into CGI's repo. Would this be a welcome change?

* I've e-mailed the author (Paul Battley) privately, and got his blessing to do so.
* It's MIT licensed, so that should be OK.




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread