Moodle plugins directory: Auto non-breaking space filter | Moodle.org
Auto non-breaking space filter
Filters ::: filter_vowels
Maintained by Kamil Łuczak
Auto change spaces after chosen one-letter conjunctions and prepositions or words into non-breaking space -
You can specify single characters and words after wchich space will be changed into non-breaking space.
Latest release:
18 sites
2 downloads
5 fans
Current versions available: 1
One-letter conjunctions and prepositions (a, i, u, w, etc.) may remain at the end of the line in continuous text, while in book titles and their chapters they should be moved to the next line.
This principle is generally known. If a one-letter conjunction or preposition (i.e. so-called orphan, pendant, or hanging conjunction), type a, i, u, w, etc., appears at the end of a line. - It is better to move it to the next line. Leaving such words at the end of the line is not a mistake, but in practice it has been accepted to always move them, not only in the titles. It simply looks more aesthetic.
This filter changes all spaces between selected single character (like `a i o u w z`) to an ` `
It is specially non-estetic on Polish sites.
So paragraph like this:
> The quick brown fox jumps over a
> lazy dog.
Will be displayed as:
> The quick brown fox jumps over
This principle is generally known. If a one-letter conjunction or preposition (i.e. so-called orphan, pendant, or hanging conjunction), type a, i, u, w, etc., appears at the end of a line. - It is better to move it to the next line. Leaving such words at the end of the line is not a mistake, but in practice it has been accepted to always move them, not only in the titles. It simply looks more aesthetic.
This filter changes all spaces between selected single character (like `a i o u w z`) to an ` `
It is specially non-estetic on Polish sites.
So paragraph like this:
> The quick brown fox jumps over a
> lazy dog.
Will be displayed as:
> The quick brown fox jumps over
> a lazy dog.
You can also enable function that changes spaces after or/and before selected words into hard spaces.
Useful links
Contributors
Kamil Łuczak (Lead maintainer)
Please login to view contributors details and/or to contact them
http://integration.moodle.org/job/Precheck%20remote%20branch/14145/artifact/work/smurf.html
Thanks Kamil for sharing this filter with the Moodle community. I was able to check the basic functionality and do a quick code review. It seems the current version would also process text inside the value of attributes - such as
<img src="..." alt="Bolek i Lolek">
- and also, as you mention in a todo comment in the code, in javascript and other places. I am sure you will want to address this is a future update of the filter. Also, let me recommend to add unit tests your filter. You will find them really useful during further development.I am going to approve the plugin now. You are cleared to land, welcome to the Plugins directory!
I will try to share the new version before end of weekend.
Proszę pana wziąć pod uwagę, że Pana filtr w Moodle 4.0.2 + PHP 7.4 generuje wiele ekzemplarow błędu, podobnego do
"PHP Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /.../filter/vowels/filter.php on line 108"
Jeśli pan może to naprawić, będe wdzięczny o nową wersję wtyczki.