Daniel Brötzmann pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/common/styling.py
    ... ... @@ -199,7 +199,7 @@ def process(text: Union[str, bytes], nested: bool = False) -> ParsingResult:
    199 199
                 for line in block.text.splitlines(keepends=True):
    
    200 200
                     block.spans += _parse_line(line, offset, offset_bytes)
    
    201 201
                     block.uris += _parse_uris(line, offset, offset_bytes)
    
    202
    -                block.emojis += _parse_emojis(line, offset, offset_bytes)
    
    202
    +                block.emojis += _parse_emojis(line, offset)
    
    203 203
                     offset += len(line)
    
    204 204
                     offset_bytes += len(line.encode())
    
    205 205
     
    
    ... ... @@ -320,20 +320,19 @@ def make(match: Match[str], is_address: bool) -> BaseUri:
    320 320
         return uris
    
    321 321
     
    
    322 322
     
    
    323
    -def _parse_emojis(line: str, offset: int, offset_bytes: int) -> list[Emoji]:
    
    323
    +def _parse_emojis(line: str, offset: int) -> list[Emoji]:
    
    324 324
         emojis: list[Emoji] = []
    
    325 325
     
    
    326 326
         def make(match: Match[str]) -> Emoji:
    
    327 327
             return _make_emoji(line,
    
    328 328
                                match.start(),
    
    329 329
                                match.end() - 1,
    
    330
    -                           offset,
    
    331
    -                           offset_bytes)
    
    332
    -    
    
    330
    +                           offset)
    
    331
    +
    
    333 332
         for match in EMOJI_RX.finditer(line):
    
    334 333
             emoji = make(match)
    
    335 334
             emojis.append(emoji)
    
    336
    -    
    
    335
    +
    
    337 336
         return emojis
    
    338 337
     
    
    339 338
     
    
    ... ... @@ -417,8 +416,7 @@ def _make_link(line: str,
    417 416
     def _make_emoji(line: str,
    
    418 417
                     start: int,
    
    419 418
                     end: int,
    
    420
    -                offset: int,
    
    421
    -                offset_bytes: int) -> Emoji:
    
    419
    +                offset: int) -> Emoji:
    
    422 420
         text = line[start:end + 1]
    
    423 421
         start += offset
    
    424 422
         end += offset + 1