Overview
Comment: | [fr][bug] formateur de texte: URL |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | fr |
Files: | files | file ages | folders |
SHA3-256: |
001f5897d2ed9552804d6c59d056f972 |
User & Date: | olr on 2017-06-27 08:49:05 |
Other Links: | manifest | tags |
Context
2017-06-27
| ||
13:38 | [fr][oxt] formateur de texte: table de remplacement séparée check-in: 58cdb431b8 user: olr tags: trunk, fr | |
08:49 | [fr][bug] formateur de texte: URL check-in: 001f5897d2 user: olr tags: trunk, fr | |
2017-06-26
| ||
08:45 | [fr] + 2 tests check-in: 0ff766161c user: olr tags: trunk, fr | |
Changes
Modified gc_lang/fr/modules-js/textformatter.js from [694a6a3f2d] to [fcd9e4b1a6].
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + | "nbsp_repair": [ [/([\[(])[ ]([!?:;])/g, "$1$2"], [/(https?|ftp)[ ]:\/\//g, "$1://"], [/&([a-z]+)[ ];/g, "&$1;"], [/&#([0-9]+|x[0-9a-fA-F]+)[ ];/g, "&#$1;"] ], //// missing spaces "add_space_after_punctuation":[ [/[;!…](?=[a-zA-Zà-ö0-9À-Öø-ÿØ-ßĀ-ʯ])/g, "$& "], [/[?](?=[A-ZÀ-ÖØ-ßĀ-ʯ])/g, "? "], |
︙ |
Modified gc_lang/fr/oxt/TextFormatter/TextFormatter.py from [32ab9b6099] to [63b9caa31e].
︙ | |||
421 422 423 424 425 426 427 428 429 430 431 432 433 434 | 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | + | # change pointer xPointer = self.ctx.ServiceManager.createInstanceWithContext("com.sun.star.awt.Pointer", self.ctx) xPointer.setType(uno.getConstantByName("com.sun.star.awt.SystemPointer.WAIT")) xWindowPeer = self.xContainer.getPeer() xWindowPeer.setPointer(xPointer) for x in xWindowPeer.Windows: x.setPointer(xPointer) # ICU: & is $0 in replacement field # NOTE: A LOT OF REGEX COULD BE MERGED IF ICU ENGINE WAS NOT SO BUGGY # "([;?!…])(?=[:alnum:])" => "$1 " doesn’t work properly # "(?<=[:alnum:])([;?!…])" => " $1 " doesn’t work properly self.pbar.ProgressValue = 0 # Restructuration if self.struct.State: if self.struct1.State: |
︙ | |||
514 515 516 517 518 519 520 521 522 523 524 | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | + - - - - - - - + + + + + + + | n += self._replaceText(xElem, "(?<=[:alnum:])!", " !", True) n += self._replaceText(xElem, "(?<=[]…)»}]):", " :", True) n += self._replaceText(xElem, "(?<=[]…)»}]);", " ;", True) n += self._replaceText(xElem, "(?<=[]…)»}])[?][ ]", " ? ", True) n += self._replaceText(xElem, "(?<=[]…)»}])[?]$", " ?", True) n += self._replaceText(xElem, "(?<=[]…)»}])!", " !", True) n += self._replaceText(xElem, "[ ]+([:;?!])", " $1", True) # réparations n -= self._replaceText(xElem, "([[(])[ ]([!?:;])", "$1$2", True) n -= self._replaceText(xElem, "(?<=http)[ ]://", "://", True) n -= self._replaceText(xElem, "(?<=https)[ ]://", "://", True) n -= self._replaceText(xElem, "(?<=ftp)[ ]://", "://", True) |
︙ | |||
567 568 569 570 571 572 573 | 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 | - + | if False: n = self._replaceText(xElem, "\\b(MM?\\.|Mlle|Mgr) ", "$1 ", True) self.nbsp3_res.Label = str(n) self.pbar.ProgressValue += 1 self.nbsp.State = False self._switchCheckBox(self.nbsp) self.pbar.ProgressValue = 15 |
︙ | |||
595 596 597 598 599 600 601 602 603 604 | 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | + - + - + | n += self._replaceText(xElem, "\\bm[3³]\\.s(?=-1)\\b", "m³·s", True, True) #n += self._replaceText(xElem, "\\bJ.kg-1.K-1\\b", "J·kg-1·K-1", True, True) #n += self._replaceText(xElem, "\\bW.m-1.K-1\\b", "W·m-1·K-1", True, True) #n += self._replaceText(xElem, "\\bW.m-2.K-1\\b", "W·m-2·K-1", True, True) n += self._replaceText(xElem, "\\b(Y|Z|E|P|T|G|M|k|h|da|d|c|m|µ|n|p|f|a|z|y)Ω\\b", "$1Ω", True, True) self.typo6_res.Label = str(n) self.pbar.ProgressValue += 1 # espaces manquants if self.space.State: if self.space1.State: n = self._replaceText(xElem, ";(?=[:alnum:])", "; ", True) |
︙ |