Comments (8)
This library seems like it could do the job quite well: https://github.com/JohnSundell/Ink
from nio.
Or this one, probably makes more sense than an arbitrary custom parser: https://github.com/apple/swift-cmark
from nio.
Also AttributedString, but it does not seem to have anything to output html, only to render markdown
from nio.
The HTML generated by NSAttributedString
isn't any good anyways, IIRC. I use CMark in SwiftPM Catalog to display the READMEs, and it works really well for that purpose (and is very easy to use).
from nio.
Finally, for editing, the message composition field should probably be a rich text field as well, so that users can also just bold/italic the text. So the HTML renderer is (should be) not just "Markdown to HTML", but "Markdown + AttributedString attributes to HTML".
from nio.
The HTML generated by
NSAttributedString
isn't any good anyways, IIRC. I use CMark in SwiftPM Catalog to display the READMEs, and it works really well for that purpose (and is very easy to use).
Do you have api doc for cmark-swift (or a link to a project which uses it)?
I did not yet figure out if we can add the mx-*
custom html tags. This is as far as I saw possible in Ink.
The AttributedString
is new in iOS 15 IIRC.
from nio.
AttributedString
is new in iOS 15. NSAttributedString
was new in NeXTstep.
Presumably those "mx" tags would be produced by typing @user
and #channel
and such? Not sure whether such things can be added to CMark.
In Nio however, one should deal with those in the UI anyways. I.e. if you type @
, a completion panel should pop up and then store the result as an attributed string key (and turn the text into a proper "pill"/badge).
I say "should", because this is quite a bit of work to get right :-)
from nio.
It's also there for Blockquote >
. This is AFAIK defined in the markdown spec, but resulting html is changed for matrix.
Stuff like @user
#channel
is IIRC just an a
tag, with a link (usually matrix.to)
from nio.
Related Issues (20)
- <del>Strikethrough HTML</del> leads to crash HOT 2
- Leaving a room should exist as a context menu action on the room HOT 3
- Disable iOS specific features in Catalyst build
- Copy message action
- Messages black out when highlighted.
- Reaction grouping
- Settings and New Chat buttons are missing accessibility labels in the Mio version HOT 3
- Message parsing: Replace Markdown with HTML HOT 7
- Doesn't support delegation at login HOT 2
- Message stuck at the bottom when messages fail to send HOT 3
- when are you going out of beta or testflight ? HOT 1
- Session verification HOT 2
- Allow connecting to homeservers that do not have https HOT 2
- New color for links in darkmode HOT 1
- TestFlight beta not accepting new testers
- Probable memory leak
- macOS support (and multiplatform in general) HOT 6
- Provide IPA archive for sideloading HOT 1
- Please open the Beta TestFlight to more users HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nio.