@@ 390-396 (lines=7) @@ | ||
387 | ||
388 | // This line is too long, and lines *must* be split to a new tweet if they don't fit |
|
389 | // into the current tweet. If this isn't the first line, record where we split the block. |
|
390 | if ( $line_count > 0 ) { |
|
391 | // Increment by 1 to allow for the \n between lines to be counted by ::get_boundary(). |
|
392 | $current_character_count += strlen( $current_tweet['text'] ) + 1; |
|
393 | $current_tweet['boundary'] = self::get_boundary( $block, $current_character_count ); |
|
394 | ||
395 | self::save_current_tweet( $current_tweet ); |
|
396 | } |
|
397 | ||
398 | // Start a new tweet. |
|
399 | $current_tweet = self::start_new_tweet(); |
|
@@ 441-446 (lines=6) @@ | ||
438 | if ( $current_tweet['changed'] ) { |
|
439 | // If we're already in the middle of a block, record the boundary |
|
440 | // before creating a new tweet. |
|
441 | if ( $line_count > 0 || $sentence_count > 0 ) { |
|
442 | $current_character_count += strlen( $current_tweet['text'] ); |
|
443 | $current_tweet['boundary'] = self::get_boundary( $block, $current_character_count ); |
|
444 | ||
445 | self::save_current_tweet( $current_tweet ); |
|
446 | } |
|
447 | ||
448 | $current_tweet = self::start_new_tweet(); |
|
449 | } |