Skip to content

Commit d0b374f

Browse files
Corrected rel parsing example
1 parent 10ddf11 commit d0b374f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ php-mf2 correctly handles relative URL resolution according to the URI and HTML
180180

181181
### Parsing Link `rel` Values
182182

183-
php-mf2 also parses any link relations in the document, placing them into two top-level arrays, one indexed by each individual rel value, the other by each URL. For example, this HTML:
183+
php-mf2 also parses any link relations in the document, placing them into two top-level arrays. For convenience and completeness, one is indexed by each individual rel value, and the other by each URL.
184+
185+
For example, this HTML:
184186

185187
```html
186188
<a rel="me" href="https://twitter.com/barnabywalters">Me on twitter</a>
@@ -193,15 +195,17 @@ parses to the following canonical representation:
193195
{
194196
"items": [],
195197
"rels": {
196-
"me": ["https://twitter.com/barnabywalters"]
198+
"me": ["https://twitter.com/barnabywalters"],
199+
"alternate": ["http://example.com/notes.atom"],
200+
"etc": ["http://example.com/notes.atom"]
197201
},
198202
"rel-urls": {
199203
"https://twitter.com/barnabywalters": {
200204
"text": "Me on twitter",
201205
"rels": ["me"]
202206
},
203207
"http://example.com/notes.atom": {
204-
"rels": ["alternate","etc"]
208+
"rels": ["alternate", "etc"]
205209
}
206210
}
207211
}

0 commit comments

Comments
 (0)