-
Notifications
You must be signed in to change notification settings - Fork 52
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
zmarkdown: fix image & one smiley #241
Conversation
packages/zmarkdown/config/remark.js
Outdated
@@ -140,6 +140,7 @@ const remarkConfig = { | |||
'^^': '/static/smileys/hihi.png', | |||
':o': '/static/smileys/huh.png', | |||
':p': '/static/smileys/langue.png', | |||
':P': '/static/smileys/langue.png', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should'nt we just convert emoticon
to lower case in /packages/remark-emoticons/src/index.js:36` instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps. What do you think @vhf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually don't consider smileys to be case sensitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, so I will modify remark-emoticons.
653bb7a
to
9e37b2f
Compare
I think this is mergeable @vhf? @davbaumgartner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this is as broken as the previous PRs. I'll let you find out why this time. Pointing out specific issues or explaining what's wrong didn't help in your past PRs.
@vhf: WHat I see here:
I don't see any point. |
so @vhf what can we do? Those bugs are annoying for zds members et I don't understand what you require me to do. |
What would be really annoying is adding more bugs. Please add tests dedicated to the case insensitive smileys. |
Like this one? 9e37b2f#diff-37df776abe73b7b3095b1f81808ffe4eR79 |
Yes, a bit like this one except:
|
9e37b2f
to
a6516c4
Compare
As I said in the previous PRs, I DO read the diff. But as I said in previous PRs snapshot are really hard to read. When you see a bug it's far more easier to tell me you've seen it. AS this pr is little, I managed to get your point after reading it 5 times with focus on the snapshot. If you found out the error at the first glance, I really don't get the point of not telling it. I will spli the test to extract the |
a6516c4
to
27d2095
Compare
That was not the only bug. Looking for the smiley you got, then again with both lowercase and uppercase versions cannot work. What if the configuration contains a smiley with mixed case? I fixed this bug and fixed the tests (snapshots are not well suited here) in here: #246 Regarding your other commit, wrapping an image in a figure, I'd like to understand how it should behave before reviewing the code. The two test cases are not enough to get the intent or to check whether this will behave as expected. Should all images become figures? Only the ones with an alt text and without a caption? Only images that are either inline or the only element of a block? Understanding your goal will also help deciding where this code should be, where it's now or as part of remark-captions. |
if you have an image which is not inline and not included inside a figure you must transform it as a figure. For example:
becomes <p>Hello world</p>
<figure>
<img src="image" alt=""/>
<figcaption>legend</figcaption>
</figure> Nota : the blank "alt" is not mandatory, it is an old behaviour which was not the best (alt text should always be here) If you have a legend, you get :
<p>Hello world</p>
<figure>
<img src="image" alt="alt"/>
<figcaption>Legend</figcaption>
</figure> This case is the one treated by remark-captions THen for inline images (emoticons and all images that has type |
Ok, I think I get it. Last question: Should: ![foo](http://bar)
![](http://bar)
Figure: foo give A: <p><figure><img src="http://bar" alt="foo"><figcaption>foo</figcaption></figure></p>
<p><figure><img src="http://bar"><figcaption>foo</figcaption></figure></p> or B: <figure><img src="http://bar" alt="foo"><figcaption>foo</figcaption></figure>
<p><figure><img src="http://bar"><figcaption>foo</figcaption></figure></p> |
I would say "C" : <figure><img src="http://bar" alt="foo"><figcaption>foo</figcaption></figure>
<figure><img src="http://bar"><figcaption>foo</figcaption></figure> I mean : remark-captions doesn't wrap figures between |
It does. I don't think HTML allows |
You are looking at what your browser parsed. Your browser respects the HTML spec. You should look at the HTML sent by the webserver to your browser. |
True engough, thanks for the tip. |
See the |
Since v27 deployment we got some feedback, this PR fixes two of them :
:P
anymore