Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebrewery is not able to properly autogenerate the brew title in all cases #1205

Closed
AlexeySachkov opened this issue Jan 23, 2021 · 2 comments

Comments

@AlexeySachkov
Copy link
Member

If a brew is only consist of a single line without trailing \n, the title will only contain # without the text after it. We should check if ending is -1 and use the whole string in that case:

const getGoodBrewTitle = (text)=>{
const titlePos = text.indexOf('# ');
if(titlePos !== -1) {
const ending = text.indexOf('\n', titlePos);
return text.substring(titlePos + 2, ending);

@calculuschild
Copy link
Member

calculuschild commented Jan 23, 2021

There's a PR related to this from almost a year ago, but I don't think it quite got resolved. #859

@calculuschild
Copy link
Member

This is fixed with #1214

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

No branches or pull requests

2 participants