-
Notifications
You must be signed in to change notification settings - Fork 945
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
Allow inline summary cutoff #2581
base: next
Are you sure you want to change the base?
Conversation
Honestly I'm not too sure about that. The original intent when it was added was to put it on an empty line and putting it in the middle of some HTML - I don't know... |
That's extremely fair. In my case, I don't use it very often, but the current case where I do use it is for cutting sentences off as a kind of cliffhanger. Things like "So, I took a look at X, and <cutoff>". I just made a complete version that accounts for all kinds of markdown syntax because if I was going to do anything, I might as well do it right instead of just adding a And like, I guess that there might be cases where you might want to cut off in the middle of a blockquote or something, although those are probably much rarer. If you do want it to remain on its own line, I can remove the summary-specific stuff and just keep it to fixing shortcodes for now. I do think that |
Not sure about the technical details of this PR (I haven't looked into the code), but I found that even |
Short answer, yes, Long answer, yes but it will change the code so that it actually emits the end of the paragraph and leave a cutoff marker in its place, so, you will need to modify your templates if they were manually adding the paragraph end marker back (alongside an ellipsis) in some capacity. |
This could potentially be a built-in template the user can override like The issue with putting the ellipsis in via CSS is that some user agents (Atom/RSS feed readers for example) might not load the stylesheet at all and then the ellipsis is gone entirely. I'm also not sure what implications would it have for accessibility. |
Actually, yeah, that seems the most reasonable. Could also provide the template with the contents of the summary so you could, for example, only emit an ellipsis if there isn't punctuation at the end of the line. I'll make that the default. |
c3ac709
to
de5b94c
Compare
Marking this as draft since I'm moving the shortcode fixes to a separate PR. Will rebase on top of that once it merges. |
de5b94c
to
7ecf8c7
Compare
4db3353
to
ef3ced0
Compare
Rebased this on the other change and added a template version of the summary cutoff. By default, it ends the summary in an ellipsis if it was cut off inline. |
ef3ced0
to
7cf301b
Compare
7cf301b
to
45099d5
Compare
next
branch?This worked previously, but was broken by a recent change. Essentially, because the
InlineHtml
event is not considered for the<!-- more -->
marker, it has no meaning at the moment when not placed on its own line.This alters the code to allow this again, but does so in a more reasonable way:
summary-cutoff.html
template at the end of the summary if this happens, which acts depending on the summary before the cutoff and the current language. It defaults to showing an ellipsis if the summary doesn't end in punctuation.I've also added tests to verify this behaviour works.
Fixes #2562.