You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pasting in question information into the Multilingual tool I found that a single character is being removed in certain places if the text is preceded by CRLF's. For instance, if you were to post in text such as:
@p1000lang{"Spanish":" Test.
La test2.
Asegúrese test3."}
The "L" and the "A" were both captured on the second and third lines due to the code on line 175 of the multilingual_setup.js file, questions = JSON.parse(tags[id].replace('p1000lang','').replace(/\n([^@])/g, "<br>"));
Changing the code to match the other instances with the replace having the " $1" as on lines 161 and 275 will resolve the issue, however, I just want to make sure that this code is not trying to prevent something that I have not encountered yet.
Additionally, if the intent is to remove new line characters shouldn't the regex be greedy, .replace(/\n+([^@])/g, "<br>$1"));
The text was updated successfully, but these errors were encountered:
I not 100% sure if it's on purpose or not. I will take a look when I have a minute. I do know if you put a <br> tag in the field annontation (with or without the multilingual module enabled), REDCap replaces it with a carriage return. It's possible that it has something to do with the data dictionary, so if you do test it, take a look at the data dictionary after your changes and see if it gets uploaded or not. I'll try and take a look this week.
I have the same issue. When saving Hello<br><br>world as my first question, then I go back editing this field, it shows Hello<br><br>orld. Looks like $1 is fixing the issue, but I don't know why.
When pasting in question information into the Multilingual tool I found that a single character is being removed in certain places if the text is preceded by CRLF's. For instance, if you were to post in text such as:
@p1000lang{"Spanish":" Test.
La test2.
Asegúrese test3."}
The "L" and the "A" were both captured on the second and third lines due to the code on line 175 of the multilingual_setup.js file,
questions = JSON.parse(tags[id].replace('p1000lang','').replace(/\n([^@])/g, "<br>"));
Changing the code to match the other instances with the replace having the "
$1" as on lines 161 and 275 will resolve the issue, however, I just want to make sure that this code is not trying to prevent something that I have not encountered yet.
Additionally, if the intent is to remove new line characters shouldn't the regex be greedy,
.replace(/\n+([^@])/g, "<br>$1"));
The text was updated successfully, but these errors were encountered: