soundasleep / soundasleep/html2text_ruby

Options for URL matching and output

Open
#9 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
46
Forks
49
PR merge metrics
No merged PRs in 30d

Description

The code considers the href and text to be the same for both these cases:

(A) <a href="https://a.b.c">a.b.c</a>
(B) <a href="http://a.b.c">a.b.c</a>

Both are rendered as 'a.b.c'

However it does not consider the following to be the same:

(C) <a href="http://a.b.c/">a.b.c</a>

So the output is rendered as '[a.b.c](http://a.b.c/)'

I think the href in (A) should not be considered equal, whereas I expect (C) to render as 'a.b.c'.

For some circumstances, it might also be useful to keep the '[text](url)' format regardless of equality.

Maybe it would be useful to do the URL matching in a separate function that could optionally be provided by callers?

Additionally perhaps allow the output format to be varied, e.g. as
'text <url>' which seems to be common in text portions of mime mails.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named. Start by locating the URL comparison and output-format handling, then clarify which matching rules and output formats are required before defining tests that cover the proposed cases and confirm the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
content
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.