-
Notifications
You must be signed in to change notification settings - Fork 447
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
Support HTML markup in submission titles #2564
Comments
In OJS 2.x, we used to allow HTML tags in article titles, but never (IIRC) dealt with what that meant downstream e.g. in OAI consumers. Plus it causes problems for users who legitimately want to write e.g. I suggest that if we do support this, we need to support it properly (e.g. with a rich text editor). |
I have been looking for a rich text editor for a text input field, but to my surprise there seems to be none? I suggest two solutions:
|
I'd prefer option 2 -- and we already have two presentations for TinyMCE ("extended" vs. normal or something like that), so adding a third configuration for minimal controls wouldn't be too invasive. I suspect titles would be a good driving use case for choosing which buttons should be available -- suggest B/I/U, perhaps super/subscript, and a button to edit the markup. Even just facilitating copy/paste into these fields in a rich format will be a big win, I think. |
Hi @asmecher, What do you think? |
@t4x0n, the problem comes when we provide data to 3rd-party services/tools, like Google Scholar, OAI-PMH, CrossRef, etc. Most of those will expect plaintext, not HTML, and most authors will expect to have to enter plaintext, not HTML. If we standardize on accepting HTML, then it'll be necessary to strip tags from the feeds that go to 3rd-party standards. But without a tool like TinyMCE to facilitate the entry of HTML, we run the risk of having it strip legitimate uses of |
@asmecher I understand, but maybe an option can would whether for 3rd-party offer a XML file instead of HTML? ...I don't know, I am thinking in SciELO system, here an example article: http://www.scielo.cl/scielo.php?script=sci_arttext&pid=S0717-66432017000100001&lng=es&nrm=iso&tlng=en |
@t4x0n, I think the "proper" solution actually won't be so much work -- mostly it's just finding a configuration of TinyMCE that looks good when used to replace an |
mmm ok! But @asmecher, that does not resolve the 3rd-party standards, right? in OJS 2 we just put html tags for italics and was not a problem, but TinyMCE is probably a better solution, I am not familiar yet with the OJS code, so when I try for a similar solution to another issue I can’t was it :/ thanks for the reply! |
If we had TinyMCE support in the title fields...
Best of all worlds, as long as
|
Excellent! I did not know that the system can convert html to plain text! |
Hi, Basically this should do it: #3074 (of course needs some cleaning, the layout is problematic because of the prefix field and we should add However, I noticed that there is a bug in the code that probably preventes the custom toolbar of being used. For example the abstract field should use a special "rich" toolbar It is called here: And defined here: The toolbar contents are defined here: https://github.com/pkp/pkp-lib/blob/master/js/controllers/SiteHandler.js#L150 However, at least for me, I am not seeing the bullist and numlist buttons in 3.1 although the abstract field should have them while they are included in the richToolbar? @NateWr, I see that you have done work with the toolbar settings, can you confirm that this is a bug or am I missing something? |
It's been a long time since I fiddled with that so I don't have an idea off the top of my head. I'd check that the |
hmm, maybe it is missing plugins: https://community.tinymce.com/communityQuestion?id=90661000000If5QAAS |
Ok, so the richToolbar is definitely loading, Just without those two buttons. I added advlist and lists to the list of plugins, but it does not seem to make a difference. It is the richToolbar because it includes the superscript button which the default toolbar does not have. But something is wrong there anyway, but I do not have the time to look at it just now. So not sure why my pr above is not working. There is something fishy here... |
Hi @asmecher, it also looks like we have inconsistent escaping of the article title, i.e. in the issue TOC we have |
Hi, Anyway, I understood from the link above that advlist plugin is also needed. But is it workign without it as well? |
I got the tools to display with the changes I committed (on a control that was set to |
Hi @asmecher (and @NateWr, see especially the editor height issues below) Here is a new pr. You were right that it was a cache issue that caused the earlier problems. I did not test yet what ends up in the database when saving the form, or in what cases and how the html should be stripped from the titles. But these should not be that hard to add. The visual layout is of course something that could be enhanced. Note that I set the min_height value for tinymce. I had difficulties in resizing the tinymyce height until I notice that there is a code that counts the height based on the number of textarea rows: https://github.com/pkp/pkp-lib/blob/master/js/controllers/SiteHandler.js#L220 However, if that value is below 100px there is a default min_height value in tinymce that returns the height back to 100px. But you can deal with that by setting a custom min_height in the settigns like I did now. I used 20px because now the setting of 1 row will return 20px height like you would expect based on the code here: https://github.com/pkp/pkp-lib/blob/master/js/controllers/SiteHandler.js#L220. BUT there could be cases where the editor will now return a smaller editor than was expected, for example the setting of 3 rows will return 60px when it used to return 100px which was the default min_height. Another thing with the editor heights is that I noticed no visible affect when using for example |
Great work @ajnyga. I do have a few concerns about going ahead with this. Sorry to jump in so late.
I understand that this is an important feature. But we're taking something bulletproof (a plain-text field) and introducing scope for lots of human error, some of it critical -- like if a bad title is handed off to citation/indexing handlers. In my experience, taking something wide-ranging and trying to lock it down will lead us into a lot of maintenance. Every new device that comes out ends up breaking old hacks or supporting new types of entry we need to lock down. I'd be tempted to explore with the Substance people what their experience is with needs like this, how they go about sanitizing a rich text area, and see whether there might be some option which is more limiting to users. Should I reach out to them? |
Hi, You are right that the input here would need a 100% sure way of cleaning the input.
As I mentioned above, I actually tried to look for a very simple text input editor for this purpose, but really could not find one. So tinymce (or something similar) seemed like the only alternative. By all means do ask the Substance people about this, because they have probably talked about similar use cases. For us (journal.fi) this is not a big issue. One of our journals does use italics in their title, but have been doing so since 2.x and just add the tags there. |
Are you able to try those config options? My sense from reading them is that the user will be still be able to insert line breaks ( Stripping attributes may be more or less successful. I remember it used to be awful at it but not sure if that's still the case. |
Yes sure, but go ahead and contact Substance in case they have something better in mind. |
It says something that this old PKP issue is on the first page of results when I search for "tinymce restrict to single line": https://pkp.sfu.ca/bugzilla/bugslist/show_bug.cgi?id=6759 |
Hi @NateWr Referring to your list above
So I think that this is now working fairly well. |
🎉 Let's remove the "powered by" too. I think it's a config. We can keep them for the big ones, but the less clutter the better on these wee fields. Also, let's explore inline mode to reduce the iframes we're loading as well as the space the fields take up in a form. |
pkp/pkp-lib#2564 Submission title and sub title with HTML tag handling
pkp/pkp-lib#2564 Submission title and sub title with HTML tag handling
All merged except pkp/oaiJats#33 -- there's a comment there. Thanks, @touhidurabir! |
@asmecher check updated the PR at pkp/oaiJats#33 for |
) * pkp/pkp-lib#2564 Added support for HTML tags in title and sub title * pkp/pkp-lib#2564 Fixed HTML tags presentation in XML
All merged! Thanks again, @touhidurabir. |
@asmecher please review the ONIX update for |
Italics display in the TOC title (see The Poetic Life-Form: An Analysis on the Role of Elegy and Form in In Memoriam):
http://journals.sfu.ca/courses/index.php/eng435/index
But not on the article page, where the tags themselves are displayed:
http://journals.sfu.ca/courses/index.php/eng435/article/view/7
Edits
Metadata support details listed by @asmecher #2564 (comment)
PRs
App
pkp-lib --> #8584
ui-library --> pkp/ui-library#252
ojs --> pkp/ojs#3731
ops --> pkp/ops#464
omp --> pkp/omp#1329
Plugins
OAI DC, MarcXML, RSS/ATOM [
HTML Tag Support : NO
] --> No Change RequiredDC(DublinCore) [
HTML Tag Support : NO
] --> No Change RequiredgoogleScholar[
HTML Tag Support : NO
] --> pkp/googleScholar#11 [PR CLOSED]orcidProfile [
HTML Tag Support : NO
] --> pkp/orcidProfile#231crossref-ojs [
HTML Tag Support : YES
] --> pkp/crossref-ojs#25crossref-ops [
HTML Tag Support : YES
] --> pkp/crossref-ops#22medra[
HTML Tag Support : NO
] --> pkp/medra#6 [PR CLOSED]DataCite [
HTML Tag Support : NO
] --> touhidurabir/ojs@e0676e5DOAJ [
HTML Tag Support : NO
] --> touhidurabir/ojs@b080ef1PubMed[
HTML Tag Support : YES
] --> touhidurabir/ojs@ae06853jatsTemplate [
HTML Tag Support : YES
] --> pkp/jatsTemplate#22oaiJats [
HTML Tag Support : YES
] --> pkp/oaiJats#33ONIX [
HTML Tag Support : NO
] --> pkp/omp#1355The text was updated successfully, but these errors were encountered: