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

Hide cw pictures behind a summary/details #483

Merged
merged 6 commits into from
Apr 6, 2019
Merged

Hide cw pictures behind a summary/details #483

merged 6 commits into from
Apr 6, 2019

Conversation

trinity-1686a
Copy link
Contributor

This is an attempt at fixing #254
Sadly it doesn't work with the new editor, as html tags are put in a <code> bloc

@elegaanz
Copy link
Member

It makes me notice that one can copy almost any HTML in the editor, which is a bit weird, and full of bug (and maybe of security risks?). I think we should add a listener for onpaste and filter what is pasted (to only allow images or simple text)

@trinity-1686a
Copy link
Contributor Author

from what I see, any html pasted is surrounded with <code>. There are no more risks than with the previous editor. Filtering/modifying what is pasted might be nice in some situations, sometime one just want to put some html elements not supported by plain markdown

@trinity-1686a trinity-1686a added C: Enhancement New feature or request A: Front-End Related to the front-end labels Mar 16, 2019
@codecov
Copy link

codecov bot commented Mar 16, 2019

Codecov Report

Merging #483 into master will increase coverage by 0.22%.
The diff coverage is 57.89%.

@@            Coverage Diff             @@
##           master     #483      +/-   ##
==========================================
+ Coverage   24.64%   24.87%   +0.22%     
==========================================
  Files          65       65              
  Lines        7120     7196      +76     
==========================================
+ Hits         1755     1790      +35     
- Misses       5365     5406      +41

@trinity-1686a
Copy link
Contributor Author

tested with #486, the md tag is not interpreted as it is inside some html. Maybe I should put plain html instead of markdown when using cw

@elegaanz
Copy link
Member

elegaanz commented Apr 5, 2019

I think Markdown in HTML never worked. At least it doesn't on GitHub:

**hello** I'm in a `div`

So yes, going with HTML for everything seems to be a better solution. Ideally, we should have some kind of custom Markdown like ![132] where 132 is the idea of a media, and then Plume just replaces it with the full HTML code, but this is probably quite hard to achieve.

@trinity-1686a
Copy link
Contributor Author

It might not be that hard actually, we "just" have to match with the Event Start(Image(_, _, _)) and map it to our custom html

@trinity-1686a trinity-1686a added the S: Incomplete This PR is not complete yet label Apr 6, 2019
@trinity-1686a
Copy link
Contributor Author

User should input something like ![some title](123)
If the corresponding picture has a cw, it display this
Screenshot_2019-04-06_16-40-55
And after clicking on it, it shows the picture (this is a toggle, so clicking again hide it back).

@trinity-1686a trinity-1686a added S: Ready for review This PR is ready to be reviewed and removed S: Incomplete This PR is not complete yet labels Apr 6, 2019
@trinity-1686a
Copy link
Contributor Author

Hum, there is a small bug if the same picture with cw is present twice, clicking on the second will only activate the first one. I shall probably add some random to the generated id

Copy link
Member

@elegaanz elegaanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning and the image it hides doesn't have exactly the same size on my computer, but I think it is because of experiments I made with the editor.

Works perfectly otherwise. Thank you!

@trinity-1686a
Copy link
Contributor Author

trinity-1686a commented Apr 6, 2019

it's not from your experiments. It seems to came from the rule adding a 3em margin on main article img

@trinity-1686a trinity-1686a merged commit 12c2078 into master Apr 6, 2019
@trinity-1686a trinity-1686a deleted the cw branch April 6, 2019 17:20
@trinity-1686a trinity-1686a mentioned this pull request Apr 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Front-End Related to the front-end C: Enhancement New feature or request S: Ready for review This PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants