Hide cw pictures behind a summary/details #483

Unito
Plume_migration_agent ha unito 6 commit da cw a master 5 anni fa
trinity-1686a 5 anni fa ha commentato
Proprietario

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

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 5 anni fa ha commentato (Migrato da github.com)

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)

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 5 anni fa ha commentato
Autore
Proprietario

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

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
codecov[bot] 5 anni fa ha commentato (Migrato da github.com)

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
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/483?src=pr&el=h1) Report > Merging [#483](https://codecov.io/gh/Plume-org/Plume/pull/483?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/26fc2cde5da0ea8ac5b3d753d7b603929ca91acc?src=pr&el=desc) will **increase** coverage by `0.22%`. > The diff coverage is `57.89%`. ```diff @@ 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 5 anni fa ha commentato
Autore
Proprietario

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

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 5 anni fa ha commentato (Migrato da github.com)

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.

I think Markdown in HTML never worked. At least it doesn't on GitHub: <div> **hello** I'm in a `div` </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 5 anni fa ha commentato
Autore
Proprietario

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

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 5 anni fa ha commentato
Autore
Proprietario

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).

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](https://user-images.githubusercontent.com/35889323/55670981-f45d5800-588a-11e9-82f9-d66f151c10c2.png) And after clicking on it, it shows the picture (this is a toggle, so clicking again hide it back).
trinity-1686a 5 anni fa ha commentato
Autore
Proprietario

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

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
elegaanz (Migrato da github.com) hanno approvato queste modifiche 5 anni fa
elegaanz (Migrato da github.com) lascia un commento

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!

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 5 anni fa ha commentato
Autore
Proprietario

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

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

Revisori

La pull request è stata unita come 12c2078c89.
Puoi anche visualizzare le istruzioni da riga di comando.

Passo 1:

Dal repository del tuo progetto, fai il check out di un nuovo branch e verifica le modifiche.
git checkout -b cw master
git pull origin cw

Passo 2:

Fai il merge delle modifiche e aggiorna su Forgejo.
git checkout master
git merge --no-ff cw
git push origin master
Effettua l'accesso per partecipare alla conversazione.
Nessun revisore
Nessuna milestone
Nessuna assegnatario
2 Partecipanti
Notifiche
Data di scadenza
La data di scadenza non è valida o fuori intervallo. Si prega di utilizzare il formato 'aaaa-mm-dd'.

Nessuna data di scadenza impostata.

Dipendenze

Nessuna dipendenza impostata.

Riferimento: Plume/Plume#483
Caricamento…
Non ci sono ancora contenuti.