hniksic / emacs-htmlize

Convert buffer text and decorations to HTML.
192 stars 45 forks source link

put style in <pre> for inline-css #10

Closed tpapp closed 6 years ago

tpapp commented 6 years ago

When htmlize-region-for-paste is used, the background color of the buffer is not used, which can lead to weird-looking outputs (eg with whitespace-mode). Please have inline-css put style in the <pre> tag, like for <body>.

hniksic commented 6 years ago

Thanks for the PR. The patch looks good, but omitting the background color was intentional, to avoid pasted code snippets forcing their own background different from the rest of the document.

Can you please describe or show the weird-looking whitespace-mode output?

tpapp commented 6 years ago

I wanted to use emacs-htmlize to make something like a screenshot (a more or less exact reproduction of what I see on the screen) of a region, but I understand that some would rather have a transparent background for the reasons above.

I uploaded a screenshot with an omitted background, and a gist of various outputs. Because I have harmonizing colors in whitespace-mode, without a background they look weird.

Perhaps if I added a customizable option for including style with <pre>?

hniksic commented 6 years ago

Thanks for the screenshots, I now understand what you mean. Do you think a "screenshot" or a dedicated command would be more useful?

tpapp commented 6 years ago

Possibly. Should I make a PR?

hniksic commented 6 years ago

Sorry, I meant to write: do you think a "screenshot" option or a dedicated command would be more useful?

Either way, please do make a PR, it's a valuable change.

tpapp commented 6 years ago

I made a new PR https://github.com/hniksic/emacs-htmlize/pull/12, making the whole change optional, and adding a 'screenshot' function.

tpapp commented 6 years ago

Is there anything else I should do to make this PR accepted?

hniksic commented 6 years ago

No, I'll merge it when I get back from vacation in a couple of days.

On Mon, Oct 9, 2017, 16:53 Tamas K. Papp notifications@github.com wrote:

Is there anything else I should do to make this PR accepted?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/hniksic/emacs-htmlize/issues/10#issuecomment-335182457, or mute the thread https://github.com/notifications/unsubscribe-auth/ABBzriXEYdLD2rOazComhAogV2jCm5Fbks5sqjNZgaJpZM4PorXg .