Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[IMPROVEMENT] Remove @ and add left & right spacing to mentions #2436

Merged
merged 8 commits into from Dec 20, 2018

Conversation

cardoso
Copy link
Collaborator

@cardoso cardoso commented Dec 18, 2018

@RocketChat/ios

TODO: tests for the dangerous NSRange methods

Closes #2289

@cardoso cardoso added this to the 3.3.0 milestone Dec 18, 2018
@codecov
Copy link

codecov bot commented Dec 18, 2018

Codecov Report

❗ No coverage uploaded for pull request base (develop@8e45a6a). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #2436   +/-   ##
==========================================
  Coverage           ?   25.97%           
==========================================
  Files              ?      447           
  Lines              ?    16817           
  Branches           ?        0           
==========================================
  Hits               ?     4369           
  Misses             ?    12448           
  Partials           ?        0
Impacted Files Coverage Δ
...Chat/Extensions/NSAttributedStringExtensions.swift 84.21% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e45a6a...dc721a7. Read the comment docs.

@cardoso cardoso changed the title [WIP][IMPROVEMENT] Remove @ and add left & right spacing to mentions [IMPROVEMENT] Remove @ and add left & right spacing to mentions Dec 20, 2018
// "\u{00a0}" = non-line-breaking space character
self.insert(NSAttributedString(string: "\u{00a0}"), at: range.location)
self.insert(NSAttributedString(string: "\u{00a0}"), at: range.location + range.length + 1)
return NSRange(location: range.location, length: range.length + 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤓

@@ -2,7 +2,7 @@
// NSAttributedStringExtensionsSpec.swift
// Rocket.Chat
//
// Created by Matheus Martins on 9/11/17.
// Created by Matheus Cardoso on 9/11/17.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Contributor

@rafaelks rafaelks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely!!! Really nice! 👍

@rafaelks rafaelks merged commit c81e863 into develop Dec 20, 2018
@rafaelks rafaelks deleted the imp/mentions branch December 20, 2018 21:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants