fix: external_link should use after_render#3675
Conversation
c65a6c1 to
1caaa39
Compare
|
not sure why it fails the test (including local unit test). It works in actual use case. |
|
I don't see why If there are external links that not in the post.content, which means those links is in the theme layouts, then |
I assume user expects We can't expect user to verify the rendered html and modify the theme accordingly. |
For me, best practice is to let user decide which to choose, but adding a configuration might cause a break change and have no backward compatibility. |
you mean choosing which links to apply? I understand this approach incur performance cost, but this is necessary for consistency. What I meant in previous comment is that we can't expect to verify each and every |
|
On the user customization, we can introduce an extra option (e.g. |
|
IMHO, since we are going to release a big version external_link:
enable: true
onlypost: false
exclude:
- 'exclude1.com'
- 'exclude2.com'And still accept |
|
I can introduce |
9c91d97 to
979c749
Compare
|
rebased |
979c749 to
4774444
Compare
|
rebased |
4774444 to
c9ee039
Compare
c9ee039 to
3913a44
Compare
Added in latest commits. |
* also move meta_generator to after_render/ folder
|
btw, I did attempt to dedup based on approach used in hexo-filter-nofollow, but somehow it affects other unit tests. |
004e156 to
26b010a
Compare
|
Rebased to fix failing test. |
- pretty_urls.trailing_index: hexojs/hexo#3691 - external_link.enable: hexojs/hexo#3675 - meta_generator: hexojs/hexo#3653 - use_date_for_updated: hexojs/hexo#3235
- pretty_urls.trailing_index: hexojs/hexo#3691 - external_link.enable: hexojs/hexo#3675 - meta_generator: hexojs/hexo#3653 - use_date_for_updated: hexojs/hexo#3235
- pretty_urls.trailing_index: hexojs/hexo#3691 - external_link.enable: hexojs/hexo#3675 - meta_generator: hexojs/hexo#3653 - use_date_for_updated: hexojs/hexo#3235
What does it do?
after_post_renderonly applies to rendered posts/pages, so external_link doesn't work on links specified in themes. This PR fixes that by usingafter_render:htmlinstead.Added options
Backward compatible with
How to test
Pull request tasks