Re: Is it possible to translate "cpp}" into "C++" instead of "C+C+"?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to translate "cpp}" into "C++" instead of "C+C+"?

mojavelinux
Administrator
Daniel,

Thank you for your question. The plus sign in AsciiDoc has special meaning, and the double plus is a particularly strong markup sequence (unconstrained monospace). Therefore, it must be escaped to use it in content without being interpreted. That's the whole point of the built-in cpp and pp attributes. If the value of these attributes use literal + characters, then they could still get interpreted as a formatting mark depending on the order of substitutions (though not with normal substitution order). That's why + is used instead.

> I am afraid this would hinder Google indexing of my pages.

I guarantee you it would not affect indexing. Character references are a standard part of HTML. If an HTML parser did not expand them, then it would be exceptionally broken. And Google search definitely does not have that problem.

Regardless, if ending up with literal + characters in your output is very important to you, you are free to redefine the attributes in the document header or via the CLI or API.

:pp: ++
:cpp: C{pp}

Best Regards,

-Dan

On Fri, Oct 23, 2020 at 1:57 PM daniel.langr [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I wonder whether it is possible to render "{cpp}" as "C++" instead of "C++" in the generated HTML. Since I am writing a blog about C++, I use it a lot (even in page titles and descriptions) and I am afraid this would hinder Google indexing of my pages. Even Google Style Guide recommends using characters instead of HTML entities if possible (https://google.github.io/styleguide/htmlcssguide.html#Entity_References).


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Is-it-possible-to-translate-cpp-into-C-instead-of-C-43-C-43-tp8281.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux