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

New line in "authorComments" in metadata: h5p file can't be imported #96

Open
JsBergbau opened this issue Dec 8, 2020 · 3 comments
Open

Comments

@JsBergbau
Copy link

If you enter text in the field "Autor comments" and hit Enter a new line is generated, like here
grafik

In the JSON is then

"authorComments":"Test\nTest"

As long as the h5p stays in your LMS no problem, but when you try to import in another sytem it fails
grafik

I think the error is in https://github.com/h5p/h5p-php-library/blob/master/h5p.classes.php

'authorComments' => '/^.{1,5000}$/',

When you try it here https://regex101.com/r/IS3lUT/1 it finds no match. When you remove the second line, it matches again.

I've tried in course presentation and Find the words, in both this error occurs.

@otacke
Copy link
Contributor

otacke commented Dec 8, 2020

@JsBergbau I agree, the regular expression doesn't cover this case. Would your mind creating a pull request to fix the issue?

@JsBergbau
Copy link
Author

Done #97

@otacke
Copy link
Contributor

otacke commented Dec 8, 2020

@JsBergbau Cool! Hope the H5P core team will find time to take care of it soon.

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