Drupal 8 markdown filter - drupal

I'd like to be able to enter markdown into a plain text field and output some text as bold. I.e. 'This is bold text'.
Using the (Markdown input filter module), I'm trying to set up the plain text input filter to swap out the markdown for html. The current plain text filter is configured like this.
However, whatever configuration I try, it still just outputs the asterisks. Am I missing something or trying to achieve something that's not possible with the plain text input format?
Thank you in advance.

Related

How to underline a link in R markdown?

I am creating a r markdown script to create a word document and I am pulling need to include a series of hyperlinks. However the links end up looking very similar to Word headings and I've been told to underline them to help distinguish.
my current code is something like this:
[dat$title](dat$link)
and I've tried
[dat$title](dat$link){.underline} and [dat$title]{.underline}(dat$link)
but the first doesn't work and the second ends up printing the url alongside the title.
You can wrap the link inside a <span>-element and specify the style-attribute like so:
<span style="text-decoration:underline"> [title](link) </span>.

Convert html tagged text to string for a pdf itext7

I am working on a project in asp.net MVC which involves printing various information that the user enters previously.
I use the TinyMCE for comment type fields.
As we know Tiny allows you to format text using different types of fonts, adding bold words, etc.
The string it produces will have tags that allow reading the style chosen for the word or phrase in HTML.
I use Itext7 to produce pdfs, when I print the fields I mentioned above, obviously all the HTML tags are shown, for example:
<p> Hello World! </p>
Is there a way to tell Itext7 that when these tags are present, it must use an associated style for that tag?
I created "Hello World" here and used bold, italic and underline. Copy the source code via "Tools" and just use the following code to convert it via iText7:
String htmlString = "<p><span style=\"text-decoration: underline;\"><em><strong>Hello World</strong></em></span></p>";
HtmlConverter.convertToPdf(htmlString, new PdfWriter(destinationFolder + "test.pdf"));
The resultanting PDF:

Coloring Strings in VarDumper

When I output my logs in the dump() function using VarDumper, Is there any way I can change the color of some of the text in the strings that it outputs? I know this isn't the standard use of the function but If i want to view logs in an easy to read way Vardumper is great for this.
For instance, the strings are entirely green. If i add any HTML, it gets directly written to the page and not styled at all. I can't make text bold or anything.
Is there any workaround of this at all? In Unix I know I can escape the echo and write a number and it will color the following text red, Is there anything Like that I can do?
You should be able to use Dumpers, specifically the HtmlDumper to fiddle with the formatting of the HTML output.
$dumper = new HtmlDumper();
$dumper->setTheme('light');
$dumper->dump('Hello World!');
I imagine you could then extends the HtmlDumper Class to add your own themes.

Can I add pdf tags to R markdown document?

I am trying to make a "accessible" or 508 compliant PDF using R markdown. To do this I need to have pdf tags attached to figure that provide alternative text. I also need to be able to add tags to section headers etc.
The idea is if you open the pdf in a pdf viewer that then the tags are read in in the "table of context" and allow a user to move between sections.
If you use a markdown header like
# header
R markdown seems to add a label to this so it appear in the table of context. I would like to be able to add these kind of labels manually as well.
Does anyone have any ideas of how to do this?
You should be able to achieve this using pandoc formatting (see http://pandoc.org/MANUAL.html), for example the alt text for an image can be specified as ![alt text or image title](path/to/image)

Export Superscript text to worddoc from HTML

In my asp.net website I have a HTML page which contains some words with Superscript, for example the HTML representation is as below...
ABC<sup>def</sup>
when it is rendered in browser it appears like this : ABCdef
I have a export feature which export the HTML document to a word document. When I am exporting it is being exported as ABC<sup>def</sup> in the worddoc.
I have been trying to do it using some kind of regex html = html.Replace("<sup>", "\"");
but that doesn't help.
Can anybody please help me how would I make it appear as ABCdef in my word document too using asp.net?
This is an older question but I've been trying to do the same thing in reverse. The problem is with how Word formats and defines its super and subscripts.
There are no tags that Word used to define super and subscripts, it uses relative positioning and font-size declarations to generate symbols that look like super and subscripts.
Unfortunately there is no reliable regex to turn Word's positioning into super/subscripts, and there is no way to regex a document with those tags to make Word recognize them.

Resources