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

excerpt and more cam differ from content #2538

Closed
sy1vain opened this issue Apr 28, 2017 · 6 comments
Closed

excerpt and more cam differ from content #2538

sy1vain opened this issue Apr 28, 2017 · 6 comments
Labels
bug Something isn't working

Comments

@sy1vain
Copy link

sy1vain commented Apr 28, 2017

The contents of the excerpt and more can differ from content on render.

This is caused by the excerpt filter being run too early.

Easiest reproducible example:

  • create new hexo project
  • hero serve and open served project
  • all external links open in new tab
  • add <!--more--> tag to hello-world.md
  • refresh served project
  • all external links do not open in new tab

external_link filter (and possible others) are run after the except filter and only change the content and not the excerpt and more. So the content gets modified after the split.

hexo: 3.3.1
hexo-cli: 1.0.2
node: 6.10.0

@NoahDragon NoahDragon added need-verify bug Something isn't working and removed need-verify labels Apr 28, 2017
@NoahDragon
Copy link
Member

I have verified and reproduced this issue. I think simply swap the order of external_link and except could fix it.

NoahDragon added a commit that referenced this issue Apr 28, 2017
@NoahDragon
Copy link
Member

I have created a PR to fix this #2539

@coveralls coveralls mentioned this issue Apr 28, 2017
2 tasks
NoahDragon added a commit that referenced this issue Apr 28, 2017
@NoahDragon
Copy link
Member

The fix will merge into next build. Thanks for submitting the issue. 😄

@sy1vain
Copy link
Author

sy1vain commented Apr 28, 2017

But if you add a custom filter (say, in a theme) what is the order it is processed? Is it then still the last step? Shouldn't the default be to have it execute last. In that case we can give it a priority if Number.MAX_SAFE_INTEGER

@NoahDragon
Copy link
Member

If you add a custom filter, the process order is hexo filters then custom filters. As the external_link is handled by hexo filters, so it should be fine if add custom filters.

@sy1vain
Copy link
Author

sy1vain commented Apr 28, 2017

Thanks for clearing that up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants