html export option to NOT compress multiple spaces in emacs org mode - emacs

While doing html-export in org-mode, multiple spaces are compressed to a single space. Is there a way to change this default behaviour. (I do not wish to replace extra spaces with nbsp)

I just tested this, and org-mode does not appear to delete spaces from the content when using org-export-as-html.
Web browsers, of course, do collapse white-space when rendering HTML.
I suggest you look into the white-space CSS property (the pre-wrap value is probably what you want), along with Org Mode's support for CSS in exported HTML:
M-: (info "(org) CSS support") RET

Related

Mark-up for bold and italic in emacs org-mode

In emacs org-mode, we can use mark-ups to set Emphasis and monospace.
e.g.
*bold*
/italic/
How can we make a word both bold and italic?
It seems neither */.../* nor /*...*/ works.
In fact, both of these do work.
/*test*/
exports to HTML as
<i><b>test</b></i>
*/test/* works similarly. LaTeX / PDF export also works as you expect.
Org itself doesn't fontify both the bold and italic, but the semantics are fine.
Expanding on #Chris answer covering semantics being there, if you're interested in visible fontification effect inside your org notes, you have three approaches:
Highlight parts of your text
Nesting works nicely as long as you don't need to start / end two tags at once.
Use multiple tags with escape symbols
The closest you can get is
The code is:
*\ /\ _\ ~fontification can be nested~\_\/\*
So you need \​​ ​ (backslash and space) to escape following opening tags and \ (backslash) to escape following closing tags.
The need for space is annoying, and in it looks like this when exported to html:
So yes, you can have multiple mark-ups at once, but you have to choose between seeing the effect in emacs or having it nicely formated on export.
Modify how markup looks in emacs
Alternatively you could change how mark-up looks in emacs without modyfing exporting format, i.e. to make bold look red you'd need this:
(add-to-list 'org-emphasis-alist
'("*" (:foreground "red")
))
as covered in this great question and answer.

Is there a way to make emacs ispell/aspell ignore shoft hyphens in HTML?

I write mostly my documentation in HTML using emacs as my main editor. Emacs let you interactively spell-check the current buffer with the command ispell-buffer. (I think the underlying program used for doing the spell-check is named aspell.)
When emacs is in HTML-mode, text is stripped for all HTML markup before the remaining text is being spell-checked.
However, soft-hyphen entities (­ or ­) are not stripped, so a word that is written as speci­fies in the HTML text is spell-checked as two separate words (speci and fies) which is not what is wanted.
Is there a way to make emacs ispell/aspell ignore shoft hyphens in HTML?
Or can anyone suggest an elisp function that will strip soft hyphens out of the HTML text before it being handed over to aspell for spell-checking?

Escaping characters in Emacs org-mode

Say I want to escape characters in org-mode, e.g. _ so that org-mode renders the following:
* _TARGET_
In my set up (which I think is the default one) org-mode underlines the word as opposed to rendering _TARGET_
More generally, where can I find information about how to escape characters in Emacs org-mode?
The code and verbatim markup will render the text inside as-is, without interpretation. Therefore, =_TARGET_= will probably work as you intend (you'll also get a different monospace typeface for that word).
With a current Emacs and org-mode you might try
* \under{}TARGET\under{}
If that is not automagically displayed as * _TARGET_ just try C-c C-x \, that should toggle the display of those codings between coding characters and coded character.
(In principle the same as I explained here.)
If you want to break org to interpret some syntax you are using, you will have to ways to do that.
Using escape char. _ is \under and * is \ast, so you can write like this \ast \under{}TARGET\under;
Another way is to use zero width space, its code is 200B, so you can use C-x 8 RET 200b RET to insert a zero width space to break the interpreting.
They work on the latest org on the responding time (latest 9.2).
Alternatively, use the normal shell backslash to escape the characters you want to avoid Org-mode interpreting as markup:
* \_TARGET\_
The backslash characters are visible in your Emacs buffer, but are hidden when exporting - e.g. to HTML or PDF-via-LaTeX.
This escaping works in many other situations, e.g. SR\_1234 to render as SR_1234 during export rather than as a subscript.

Emacs w3m export highlighted area as text

How can I copy text from emacs-w3m when the content is placed in a table? Currently, it copies the table-formatting and boundaries as well. Is there a export as text for w3m?
No. w3m.el uses the w3m browser to render web pages, dropping the text into an Emacs buffer. Tables do not have any additional formatting associated with them, so Emacs has no way of distinguishing them from surrounding text.
The only solution would be to write your own code to filter out the table formatting and boundaries. There is no pre-made solution.

How do I modify text while keeping the original fontification?

I'm writing a mode which is actually a glorified markdown reader. It's a read-only mode however, and though I'd like to change the faces for bold, italics, and links, I'd love to remove the decorations surrounding those faces. However, when I do so, I lose the fontification. Is there anyway to modify fontified-text to something that no longer matches any of the syntax regexes and still keep the fontification?
Org-mode does this for its link markup. I'm not a mode writer (yet), but Org-mode would be the first place I'd look for code that demonstrates how to do this. Oddly, it doesn't do it for any of its fontification: italic, bold, and underline all retain their markup.
Specifically, the code to hide the link markup is on line 4612 of org.el in version 7.01 of org-mode:
(if org-descriptive-links (add-to-invisibility-spec '(org-link)))
where add-to-invisibility-spec is actually supplied by a built in elisp file subr.el, and allows specific types of markup to be hidden. That would be the approach I would take, especially if the buffer is read-only.