prismicio-community / php-kit

Community maintained development kit for Prismic and the PHP language
https://prismic.io
Other
109 stars 83 forks source link

Do not hyperlink text when LinkResolver returns null #60

Closed tremby closed 10 years ago

tremby commented 10 years ago

Treat the link as broken if the LinkResolver returns null. This allows the application developer to decide when a link is broken (which may depend on context, as well as on $link->isBroken()), and log an error if they like.

FakeLinkResolver has been updated to return null when $link->isBroken() is true.

Behaviour before this patch was to render <a href="">link text</a>.

This fixes issue #21

tremby commented 10 years ago

Ignore for now -- I neglected linked images. Working on that at the moment...

tremby commented 10 years ago

Should now be good to go.

tremby commented 10 years ago

If there are any other places where links are rendered other than in HyperlinkSpan and ImageView, I haven't added this logic there. Can you think of any others?

rudyrigot commented 10 years ago

Nope, I believe there is nowhere else!

This is definitely a cleaner way, thanks a lot for this!