conorhastings / conorhastings/react-native-syntax-highlighter

Multi-line comments don't render

Open
#22 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
184
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Multiline comments seem to have some visual oddities:
- When rendering standard multiline comments (`/* ... */`), any line that does not have a start or end comment marker (`/*` or `*/`) gets rendered as standard text.
- When rendering documentation headers(`/** ... **/`), every line except the first renders correctly as a comment

These issues are reproducible through the snack demo via the following code:
```javascript

import React from 'react';
import { Text, View } from 'react-native';
import SyntaxHighlighter from 'react-native-syntax-highlighter'; // 2.0.0
import { tomorrow } from 'react-syntax-highlighter/styles/prism' // 7.0.1

const code = `
/* this is the header
of this very complicated
function

it is very important
that we keep track
of all of this context */
function veryImportant() {
doSomething();
}

/**
* @description This does something
* @params [optionalParam]
* @returns A value
**/
function doSomething(optionalParam) {
console.log("wowza")
}
`;

export default class App extends React.Component {
constructor() {
super();
this.state = { code };
}
render() {
return (

React Native Syntax Higlighter

{this.state.code}


);
}
}

```

![image](https://user-images.githubusercontent.com/4605379/73575320-eb56fc00-4445-11ea-848c-5a0e8de1fd39.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.