question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feature: Able to match newline in onTextInput handler

See original GitHub issue

When implementing heading (H1, H2, H3) in WYSIWYG markdown editor, it would requires detecting if newline is entered. So I can do something like this:

editor.onTextInput({
  // "# " -> h1, "## " -> h2, "### " -> h3
  match: /^(#{1,3})(.*)\n/,
  run() {
    // magic happens here
  }
});

Is this possible in current structure?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
eguitarzcommented, Sep 6, 2016

@bantic That sounds perfect to me! I’ll work on this - Add willHandleNewline hook prior to handleNewLine and will stop handling new line if willHandleNewline returns explicit false (It works as default if willHandleNewline didn’t return or it returns true).

0reactions
banticcommented, Sep 9, 2016

I believe this is closed by #489. thanks @eguitarz ! Feel free to reopen if necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regular Expression to match every new line character (\n ...
Do you want to be able to access all the matched newline characters? If so, your best bet is to grab all content...
Read more >
Regular Expression in Python with Examples | Set 1
Matches any character except newline. |, Means OR (Matches with any of the characters separated by it. ? Matches zero or one occurrence....
Read more >
Queries | React Native Testing Library - Open Source
Returns a ReactTestInstance for a TextInput with a matching placeholder – may be a string or regular expression. import { render, screen }...
Read more >
TextInput - React Native
A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, ...
Read more >
TextInput QML Type | Qt Quick 6.4.1
The TextInput type displays a single line of editable plain text. ... If the family isn't available a family will be set using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found