michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
32 stars 44 forks source link

Line breaks in Atto cause strftime tags not to work #191

Closed joostelshoff closed 2 years ago

joostelshoff commented 2 years ago

With the 2.2.0 version of the plugin, it seems that the strftime tags such as {coursestartdate strftimedate} don't work, because the ATTO editor has a tendency to add a line break
tag after in in lists.

It took me some time to figure this out, and can be easily solved by someone with HTML knowledge, but is a bit of a nuisance for teachers without that skillset.

michael-milette commented 2 years ago

Hi @joostelshoff ,

Could you please tell me more about what you think is the problem and how you think it could be solved? I have been trying to figure this out for a while now.

Best regards,

Michael

joostelshoff commented 2 years ago

Hi Michael!

I'm not a developer, but I can read code to some extent. I found this commented bit for every 'strftime' type tag, saying // Hack to remove everything after the closing }, but I don't know if that bit is affecting the handling of time/date type tags... But I do think these tags are the only ones directly working with the PHP support? The other strings just handle layout (Bootstrap CSS) or relevant info stored in the database.

michael-milette commented 2 years ago

Without the hack, you would think that it would work perfectly (according to the code) but it was much worse. I don't know what is going on with this one and will need to work on this next time I have time, perhaps over the Christmas holidays or next summer... unless a client pays me to figure it out and fix it, or someone submits a pull request (or at least a suggestion).

michael-milette commented 2 years ago

Hi @jb-fol and @joostelshoff ,

I think I have the issues with the date/time-related tags fixed. This includes the following tags:

This fix addresses the issues described in #166 , #168 and #191 including cutting off of text and multiple instances of these tags not appearing or not being processed correctly.

The fix has been pushed to the code here on GitHub for now. If you have a chance, I would appreciate it very much if you would try it out and let me know if it works properly for you. If it does, I will include the fix in the upcoming release of FilterCodes on Moodle.org.

Best regards,

Michael

michael-milette commented 2 years ago

I am closing this issue with the assumption that it is all working now as there has been no feedback over the past month. If there is a problem, please open a new issue and mention issue #191.

Best regards,

Michael