Skip to content

parse optional cue identifiers#3

Merged
internet-diglett merged 1 commit into
mainfrom
parse_cue_identifier
Nov 12, 2021
Merged

parse optional cue identifiers#3
internet-diglett merged 1 commit into
mainfrom
parse_cue_identifier

Conversation

@internet-diglett

@internet-diglett internet-diglett commented Nov 12, 2021

Copy link
Copy Markdown
Owner

Closes #2

&str.to_cue() now handles optional cue identifiers.

use title_parser::{CueTrait};

// with cue identifier
let text = "1 - Cue\n00:01:14.815 --> 00:01:18.114\n- I'm text for a cue\n- Me too!";
let cue = text.to_cue().unwrap();
assert_eq!(cue.text, "I'm text for a cue\nMe too!");

// without cue identifier
let text = "00:01:14.815 --> 00:01:18.114\n- I'm text for a cue\n- Me too!";
let cue = text.to_cue().unwrap();
assert_eq!(cue.text, "I'm text for a cue\nMe too!");

@internet-diglett
internet-diglett merged commit 8c8fa5d into main Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cue generation needs to account for optional cue identifier

1 participant