-
Notifications
You must be signed in to change notification settings - Fork 43
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
Line breaks around multiline code blocks? #207
Comments
* The line break before the text causes an extra blank line in
messages containing only code. This might be intentional, since it
starts the code on a line not preceded by the sender username in
Pidgin.
Yes, that was the idea. It's a hack but... it works.
I experimented with changing the code to use `<pre><code>` as the
Discord web client does, but it didn't behave correctly in Pidgin.
Adding `display: block` to `style` also did not behave correctly.
As you're probably realising, Pidgin (2.x) only supports a small subset
of HTML. Pidgin3 ostensibly is better about this but it's unclear what
the status of that is.
It would be possible to add `<br/>` to the beginning/end only when
additional text is present (including or excluding whitespace).
Sounds good, as long as it's not too fragile :)
|
kevinoid
added a commit
to kevinoid/purple-discord
that referenced
this issue
Nov 9, 2018
In the Discord web client (and presumably others) multiline code blocks are rendered using `<pre><code>text</code></pre>`. Since `<pre>` is a block-level element, the text is always displayed on its own line(s). Mimic this behavior by adding a line break when text following the block would appear on the same line. Ignore collapsible white space, as a browser would. Fixes: EionRobb#207 Signed-off-by: Kevin Locke <[email protected]>
I submitted pull request #208 which adds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the support in #206! One other issue I noticed while working on that:
In the Discord web interface, multiline code blocks are rendered as
<pre><code>text</code></pre>
. Since<pre>
is a block-level element, the text is always displayed on its own line(s). This plugin currently renders multiline code blocks as<br/><span>text</span>
which behaves differently in a few cases:1```2```3
appears as in the Discord web client and in libpurple-based clients.I experimented with changing the code to use
<pre><code>
as the Discord web client does, but it didn't behave correctly in Pidgin. Addingdisplay: block
tostyle
also did not behave correctly. It would be possible to add<br/>
to the beginning/end only when additional text is present (including or excluding whitespace).What do you guys think?
The text was updated successfully, but these errors were encountered: