Skip to content

Commit

Permalink
Update list type toolbar button on native mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
hypest committed Apr 4, 2019
1 parent 08318ca commit 9dcd23b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import { getLineIndex } from './get-line-index';
*
* @param {Object} value The rich-text value
*
* @return {number} The nesting level, starting from 0.
* @return {Object} Object with { nestingLevel, listFormat }.
*/
export function getStartNestingLevel( value ) {
export function getStartListFormat( value ) {
const { text, replacements, start, end } = value;
const startingLineIndex = getLineIndex( value, start );
const startLineFormats = replacements[ startingLineIndex ] || [];
return startLineFormats.length;
const listFormat = startLineFormats.slice( -1 );
return { nestingLevel: startLineFormats.length, listFormat };
}

0 comments on commit 9dcd23b

Please sign in to comment.