christianalfoni / christianalfoni/markdown-to-react-components

Highlighting doesn't work when rendering through server

Open
#5 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
132
Forks
14
PR merge metrics
No merged PRs in 30d

Description

It returns just `code` element. By the looks of it, `CodeComponent` does just

``` javascript
this.refs.code.getDOMNode().innerHTML = hljs.highlight(this.props.language, this.props.code).value;
```

on `componentDidMount` and `componentDidUpdate`.

There has to be some better way to deal with this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the CodeComponent and its componentDidMount and componentDidUpdate paths mentioned in the issue, then trace how it is rendered on the server. Done means server rendering produces the highlighted code content instead of only a code element, with the client behavior still working.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.