Problem getting markdown previewer to read inline code

Problem getting markdown previewer to read inline code


I´m having a hard time getting the previewer to read the inline code. I know it has something to be with string literals, but I can´t quite figure it out. Here´s the code:


The problem is likely to be here:


You are immediately invoking the getMarkdownText function. Try removing the (). You may also need to add .bind(this) in its place, as you refer to this within the getMarkdownText function.


Thanks for the reply. I tried that but it doesn´t seem to work (I get a different error). The error I am getting with the string literal is:

              ## h2 Heading
              Here´s a link too: (
              Inline " is not a function


Your state.value has back ticks ( ` ) nested within back ticks, cutting the string short. Try changing the first and last back ticks to a single quote.


Thank you for answering. I tried that, but now it´s not even reading the quotes properly:

value: '# h1 Heading 
              ## h2 Heading
              Here´s a link too: (
              Inline `code`

              Indented code

              // Some comments
              line 1 of code
              line 2 of code
              line 3 of code
              Block code "fences"

An image:

![Stormtroopocat]( "The Stormtroopocat")
> Blockquotes can also be nested...
>> using additional greater-than signs right next to each other...
> > > ...or with spaces between arrows.

Ordered list

1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa

## Emphasis

**This is bold text**

__This is bold text__

*This is italic text*

_This is italic text_'


Ah, yes, because state.value is on multiple lines it needs to start and end with a back tick ` . You will need to escape any internal backticks by putting a backslash \ before them.