Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we drop trailing ? in rel-urls when there's no query string? #177

Closed
snarfed opened this issue Jan 22, 2023 · 3 comments
Closed

Should we drop trailing ? in rel-urls when there's no query string? #177

snarfed opened this issue Jan 22, 2023 · 3 comments

Comments

@snarfed
Copy link
Member

snarfed commented Jan 22, 2023

I'm seeing an odd bug. Looking at https://python.microformats.io/?url=https%3A%2F%2Ftantek.com%2F&parser=html5lib , the rel-urls item for https://tantek.com/ has text "", but it should be the emoji 🏠. Other emoji show up fine in text eg https://tantek.com/?skin=vtx correctly has 📺 :

 "rel-urls": {
  "https://tantek.com/": {
   "text": "",
   "rels": [
    "author",
    "canonical",
    "nofollow",
    "openid.delegate",
    "self"
   ],
   "title": "Choose default theme"
  },
  "https://tantek.com/?skin=vtx": {
   "text": "\ud83d\udcfa",
   "rels": [
    "nofollow"
   ],
   "title": "Choose Terminal theme"
  },
  "..."

Fwiw the 🏠 comes through fine in php-mf2, https://pin13.net/mf2/?url=https://tantek.com/

@snarfed
Copy link
Member Author

snarfed commented Jan 25, 2023

False alarm! Not an emoji parsing issue. 🏠 is coming through fine, it's just attached to https://tantek.com/? with a trailing question mark. I was confused because php-mf2 evidently strips the empty ? and merges it into the other https://tantek.com (without ?) rel-url.

@snarfed
Copy link
Member Author

snarfed commented Jan 25, 2023

Is that merging the correct behavior? Should mf2py do it? @tantek @kevinmarks 🤷🤷🤷

@snarfed snarfed changed the title Odd missing 🏠 emoji in rel-urls text Should we drop trailing ? in rel-urls when there's no query string? Jan 25, 2023
snarfed added a commit that referenced this issue Jan 25, 2023
@angelogladding
Copy link
Collaborator

The following HTML:

<a href=/? rel=foo>bar</a>

with URL: https://example.com

parses on php.microformats.io to:

{
    "items": [],
    "rels": {
        "foo": [
            "https://example.com/"
        ]
    },
    "rel-urls": {
        "https://example.com/": {
            "text": "bar",
            "rels": [
                "foo"
            ]
        }
    },
    "debug": {...}
}

and on python.microformats.io to:

{
 "items": [],
 "rels": {
  "foo": [
   "https://example.com/"
  ]
 },
 "rel-urls": {
  "https://example.com/": {
   "text": "bar",
   "rels": [
    "foo"
   ]
  }
 },
 "debug": {...}
}

Considering the original problem is no longer applicable I'm going to close this issue.

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

No branches or pull requests

3 participants