Git Product home page Git Product logo

Comments (7)

itsmesaskovic avatar itsmesaskovic commented on September 22, 2024 9

@JosuGZ I got it working using fence instead of code_block:

 fence: {
    color: '#E94B3CFF',
    backgroundColor: '#2D2926FF',
  },

from react-native-markdown-display.

iamacup avatar iamacup commented on September 22, 2024 2

just to let you know @keanfreeman i am sick of the difference between the styles and render rules so 6.0.0 just changes them all to match

Render Rule Style(s)
body body
heading1 heading1
heading2 heading2
heading3 heading3
heading4 heading4
heading5 heading5
heading6 heading6
hr hr
strong strong
em em
s s
blockquote blockquote
bullet_list bullet_list
ordered_list ordered_list
list_item list_item - This is a special case that contains a set of pseudo classes that don't align to the render rule: ordered_list_icon, ordered_list_content, bullet_list_icon, bullet_list_content
code_inline code_inline
code_block code_block
fence fence
table table
thead thead
tbody tbody
th th
tr tr
td td
link link
blocklink blocklink
image image
text text
textgroup textgroup
paragraph paragraph
hardbreak hardbreak
softbreak softbreak
pre pre
inline inline
span span

from react-native-markdown-display.

iamacup avatar iamacup commented on September 22, 2024 1

This is because of bad / confusing naming of the rules and the styles

take a look at the readme and you will see that the style for code blocks is not the same name as the rules:

const copy = `
# Boom title

Some text

\`\`\`
  Code block
\`\`\`

\`inline code thing\`
`;

const styles = StyleSheet.create({
    root: { color: "red" },
    codeBlock: { color: "blue" }
});

image

I would like to clean this up, but because of backwards compat with react-native-markdown-renderer its really tough.

from react-native-markdown-display.

keanfreeman avatar keanfreeman commented on September 22, 2024

Thanks, I appreciate it.

from react-native-markdown-display.

keanfreeman avatar keanfreeman commented on September 22, 2024

Seems like a good change!

from react-native-markdown-display.

JosuGZ avatar JosuGZ commented on September 22, 2024

Hi, I can get code_inline working, but not code_block (nor codeBlock):

Source:
image

Result:
image

My style sheet:

const styles = StyleSheet.create({
  heading1: {
    fontSize: 32,
    // backgroundColor: '#000000',
    color: '#E94B3CFF',
  },
  heading2: {
    fontSize: 24,
    color: '#E94B3CFF',
  },
  heading3: {
    fontSize: 18,
    color: '#E94B3CFF',
  },
  heading4: {
    fontSize: 16,
    color: '#E94B3CFF',
  },
  heading5: {
    fontSize: 13,
    color: '#E94B3CFF',
  },
  heading6: {
    fontSize: 11,
    color: '#E94B3CFF',
  },
  code_inline: {
    color: '#E94B3CFF',
    backgroundColor: '#2D2926FF',
  },
  code_block: {
    color: '#E94B3CFF',
    backgroundColor: '#2D2926FF',
  },
  blockquote: {
    color: '#E94B3CFF',
    backgroundColor: '#2D2926FF',
  },
});

from react-native-markdown-display.

JosuGZ avatar JosuGZ commented on September 22, 2024

@JosuGZ I got it working using fence instead of code_block:

 fence: {
    color: '#E94B3CFF',
    backgroundColor: '#2D2926FF',
  },

Thanks, it works!

Aparently, this:


    Code here

is not the same than this:

```
Code here
```

from react-native-markdown-display.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.