Skip to content

Blockquotes broken in 1.2.0 #22

@zivester

Description

@zivester

I believe there was a regression introduced in #17 . I cannot render a simple blockquote now with react-native (expo and native build).

> This is a quote

On 1.1.9 it renders correctly. On 1.2.0 it immediately fails with: "Unexpected view type nested under text node."

As I'm also running react-native @ 0.55, I'm currently exploring if it's possible to revert the isTextOnly removal and get both images and quotes working at the same time. It's not possible to have both working in either build.

EDIT: I brought back Util.isTextOnly and the detecting block, and I now have images working (but still no blockQuotes)

        if (Utils.isTextOnly(nodes)) {
            if (isBlockQuote) {
                style.push(styles.blockQuote)
                return(
                    <View key={'blockQuote_' + key} style={[styles.block, styles.blockQuote]}>
                        <Text>{nodes}</Text>
                    </View>
                );
            } else {
                return(
                    <Text key={'block_' + key} style={styles.block}>
                        <Text style={styles.text}>
                            <Text style={styles.text}>
                                {nodes}
                            </Text>
                        </Text>
                    </Text>
                );
            }
        } else {
            return (
                <View key={'block_' + key} style={styles.block}>
                    {nodes}
                </View>
            );
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions