Update to the frType javascript library

This commit is contained in:
echarp 2017-10-07 18:52:15 +02:00
parent b1c63f7e55
commit 02a4ff4dc3
1 changed files with 5 additions and 2 deletions

View File

@ -24,11 +24,11 @@
# La forme principale pour gérer les ponctuations hautes après une lettre,
# ou en début de nœud html,
# et qui peut contenir des espaces
regexp = /(^|[\wàéèêç])\s*([!?:;»%€¢]+)([\s]|[^\w\/]|$)/g
regexp = /(^|[\wàéèêç])\s*([!?:;»%€¢]+)(\s|[^\w\/]|$)/g
regexpPost = /([«])\s*([\w])/g
$ ->
$(document).on 'turbolinks:load', ->
if $('html').attr('lang') == 'fr'
# Ne devrait s'appliquer qu'à une page en français
$('body *').contents().filter ->
@ -39,6 +39,9 @@ $ ->
# un espacement
0 > ['CODE', 'PRE', 'STYLE'].indexOf this.parentNode.tagName
.filter ->
!$(this).parent().hasClass('finePre')
.filter ->
this.nodeValue.match(regexp)? || this.nodeValue.match(regexpPost)?