Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser.

HTML Documentation

Posts under HTML tag

67 Posts
Sort by:
Post not yet marked as solved
0 Replies
461 Views
Hi, I've got this html text: "<style>* {font-size: 12pt !important;color: #000000 !important;font-family: Montserrat-Regular !important;}</style>Perform the following steps:<br><u>Option 1:</u><br><p>1) Upon receiving a push notification alert, tap on the push notification to launch BIMB Authenticator</p><p>2) Verify the transaction details and choose \"Approve\"</p><p>3) Complete</p><br><u>Option 2:</u><br><ol><p>1) If you didn’t receive push notification, you may launch BIMB Authenticator</p><p>2) Verify the transaction details and choose \"Approve\"</p><p>3) Complete</p>" And I'm trying to show this HTML text properly in a UILabel. This is my codes: String extension to map to NSAttributedString: extension String { func attributedStringFromHTML() -> NSAttributedString? { guard let data = "\(self)" .data(using: .utf8, allowLossyConversion: false) else { Log.error(category: .transaction, message: "Unable to decode data from html string: %@", self) return nil } let options: [NSAttributedString.DocumentReadingOptionKey: Any] = [ .documentType: NSAttributedString.DocumentType.html, .characterEncoding: String.Encoding.utf8.rawValue ] if let attributedString = try? NSAttributedString(data: data, options: options, documentAttributes: nil) { return attributedString } else { Log.error(category: .transaction, message: "Unable to create attributed string from html string: %@", self) return nil } } } And this is the result: Can you tell me how to fix this? Thanks.
Posted Last updated
.
Post not yet marked as solved
0 Replies
386 Views
iOS 17 Safari will not successfully open .reality (Reality Composer) files from a weblink. For example, this code works fine on iOS 16: The same code generates this message on iOS 17 after clicking on the link: "Object requires a newer version of iOS." QuickLook fails to render anything. I validated that the .reality file works fine when opened from iOS 17 Files app, so it's not a damaged file.
Posted
by FarmerTed.
Last updated
.
Post not yet marked as solved
0 Replies
642 Views
In web-based apps we want date pickers to open to a previous month based on the min-max date range specified on the input. We do not want to set a specific day but want the user to select a date. Android devices and Windows OS (Chrome and Edge) all behave as expected, namely, when the calendar loads the first month specified as the min value displays. iOS devices always open the calendar showing the current month and ignore the min/max attributes on the input. Additionally, the current date is selected making it very easy for the use to accidentally choose the wrong date by accidentally closing the date picker. It appears that iOS is the only platform not supporting min/max on date inputs. Will this be fixed? Or is it this by design? For example, today is December 13, 2023, we expect that selecting the following input to open the native calendar displaying November 2023 and to not select a date. <input autocomplete="off" type="date" placeholder="M/d/yy" min="2023-11-01" max="2023-11-30">
Posted
by lcaldwel.
Last updated
.
Post not yet marked as solved
9 Replies
743 Views
Since the update to iOS 17, the pictures in our virtual tours randomly turn very dark and high contrast. They are shown in a canvas so it looks like the entire canvas content is being manipulated. However nothing in our code does this, it happens very randomly (not in every picture and also not in the same pictures every time) and it's only in iOS 17 (not in other iOS versions, not on iPadOs, Mac, Windows, Android, ...). We tried debugging for hours and hours but nothing indicates that this is caused by anything in our code. To try it out yourself: visit https://youreka-virtualtours.be/tours/vyncke_buhler (on mobile of course). Screenshot shows what I mean. Sometime you have to click around randomly. Left screenshot in the side by side is after refresh. You can also see the effect disappears when looking at the browser tabs overview.
Posted Last updated
.
Post not yet marked as solved
1 Replies
525 Views
I allow users to choose a font to use throughout the app, then display text using that font in 3 different ways: As the default body font of an HTML document displayed in a WKWebView. Used to create an NSAttributedString then displayed in an NSTextField. Used as the body font of a very small HTML document (2-3 lines), converted to NSAttributedString, then displayed in an NSTextField. My code has been working fine for years, but starting with the release of Sonoma (macOS 14), any text that is converted from HTML to NSAttributedString displays as all "question marks in boxes" for each character. This happens when certain fonts are used. In particular I've seen it with Calibri, Candara, and SF Pro. Calibri and Candara are Microsoft fonts and I think are distributed with MS Office. SF Pro is an Apple font. There could be others; I haven't done an exhaustive check. What I can tell you is that this has been working fine literally until a couple weeks ago when customers began installing macOS 14. If they go into my app and select a different font (such as Arial or Times New Roman) everything works fine. It is only certain fonts that don't work, and those fonts work when used as the body font of an HTML document in WKWebView and when used as the font for a new NSAttributedString. They just don't work if you make a little HTML document with the font selected as the body font, then convert to NSAttributedString. Here's the code that worked up until macOS 14: NSString *htmlString = @"&amp;lt;!DOCTYPE html&amp;gt;" "&amp;lt;html&amp;gt;" "&amp;lt;head&amp;gt;" "&amp;lt;style&amp;gt;" "body { font-family: 'Candara', serif; font-size: 14px; }" "&amp;lt;/style&amp;gt;" "&amp;lt;/head&amp;gt;" "&amp;lt;body&amp;gt;" "This won't display right." "&amp;lt;/body&amp;gt;" "&amp;lt;/html&amp;gt;"; NSData *htmlData = [htmlString dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding)}; NSError *error; NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:htmlData options:options documentAttributes:nil error:&amp;amp;error]; Note the fallback of "serif" — that doesn't matter. you get all undefined characters and the fallback font is not used. It's as if the renderer really believes the font is usable, but it isn't.
Posted
by craigr.
Last updated
.
Post marked as solved
2 Replies
593 Views
The Text inside README.md or any other Markdown files added to the project's bundle, simply are not formatted when previewed in XCode. Almost all of the opensource projects have instructions in Markdown at the top level of the project & even Apple use MD in their sample projects. Magically, the .md files in Apple sample projects are formatted as expected as you can see below, but this isn't the case in any other project. I've also checked the file's settings in the XCode inspector and it didn't differ from the ones existing in the Apple code samples. This is how we are used to view Markdowns in XCode. And this is is the README.md in HappyBeam which is formatted.
Posted
by Treata.
Last updated
.
Post marked as solved
6 Replies
732 Views
This issue has already been reported to Apple via the Feedback Assistant as FB12401598 and a code-level support incident has been opened to follow up, but so far I haven't heard anything. The problem is that the NSAttributedString used to be able to load HTML files correctly via the [NSAttributedString initWithHTML:options:documentAttributes:] method (or its Swift equivalent). As of the developer beta of Sonoma, however, this no longer works. The method loads the attributedString but HTML tables are completely ignored. Every cell in the table just appears on a new line. The app I'm working on has a bunch of HTML templates that get drawn inside another View using an NSAttributedString. This has worked for years but no longer works on Sonoma. Does anyone know a decent workaround for correctly drawing some formatted text whose formatting is specified via HTML? I'm currently exploring the idea of converting the HTML files to RTF on an older system and using RTF, but the RTF format isn't nearly as simple as HTML. Here's a screenshot of a simple project and Safari showing the same HTML side by side
Posted
by jdoenias.
Last updated
.
Post not yet marked as solved
0 Replies
437 Views
I need help for this issue which is happening only in ios 17 ipad devices. I have an application which generates report in a pdf form. We are loading the html file as a string to webkit webView which is further helping us by generating the content in pdf format. our report contains rows & columns which uses div tags and few css properties. If we view the report which is in pdf form, the data is getting truncated for a row horizentally at the page end and displaying the remaing truncated data in the next page. This issue is happening only in ios 17 updated devices. It was working fine and displaying the data correctly with same html content. Please let me know any possible ways through which I can resolve this issue. I have tried few properties like page-break-X(inside,before,after)- avoid; margin-bottom, padding etc...nothing worked for me.
Posted Last updated
.
Post marked as solved
2 Replies
577 Views
I am new to developing native Apple apps and must familiarize myself with the Apple development frameworks. I am starting to create a personal document-based Apple App that can run on iOS, iPadOS, and macOS. The document will contain the following: HTML, PDF, images, video, and audio files. So, I think the document format could be HTML. I need the capability to read, edit (WYSIWYG Editor), save, and share documents with other users using the same app. The data is stored in the user's device and iCloud. I need guidance about what Apple framework I should use to edit the documents using WYSIWYG editing principles. I would really appreciate any recommendation you can provide. Many thanks for considering my request. Thank you so much for your attention and participation.
Posted
by olopul.
Last updated
.
Post not yet marked as solved
20 Replies
18k Views
webkitEnterFullScreen API is supported on iOS for video element, but not for a div element. Also as a fullscreen demo website shown, Safari on macOS supports div element but not on iOS. Is there any plan to add the support in iOS? If not is there any way to fullscreen a div element or make it run as fullscreen on Safari iOS?
Posted
by chen209.
Last updated
.
Post marked as solved
4 Replies
1.1k Views
I'm loading a page inside an iframe. The page contains a video with the playsinline attribute. The video is completely unresponsive to touch events, meaning if it fills up the screen I can't scroll past it, thus breaking the page. Note the video also has autoplay, loop and muted attributes but these did not cause scrolling issues; only playsinline causes the break. Myself and another tester are running Safari on an iPhone 14 with iOS 17.0.3 and it's broken for both of us. Confirmed with 2 additional testers there is no issue with iPhones running iOS 16.6. Test case: https://codepen.io/gem0303/pen/qBgEeaG Repro steps: Load in Safari on an iPhone with iOS 17.0.3 Tap and drag on the white background and dummy scrolling text -- works fine. Tap and drag on the cat video -- scrolling is impossible.
Posted
by gem0303.
Last updated
.
Post not yet marked as solved
0 Replies
420 Views
I am facing an issue in scrollable components as I have a parent component and child component both are scrollable but when I get to the end of my child component then it should scroll the parent component by default but it gets stuck in the child components scroll only. FYI, I am using reactJs if it helps in any case.
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.6k Views
In an attempt to expose the capabilities of NSAttributedString in combination with UITextView to the world of SwiftUI (specifically the ability to render basic HTML), I've wrapped UITextView in a UIViewRepresentable and used that in a custom SwiftUI View. But I'm seeing some issues I can't really explain... So I would love to get a deeper understanding of what's going on. And possible also find a way to fix these issues in an appropriate way. This is how it goes: UIViewRepresentable wrapping UITextView to display NSAttributedString in the context of SwiftUI import SwiftUI struct AttributedText: UIViewRepresentable { private let attributedString: NSAttributedString init(_ attributedString: NSAttributedString) { self.attributedString = attributedString } func makeUIView(context: Context) -> UITextView { let uiTextView = UITextView() // Make it transparent so that background Views can shine through. uiTextView.backgroundColor = .clear // For text visualisation only, no editing. uiTextView.isEditable = false // Make UITextView flex to available width, but require height to fit its content. // Also disable scrolling so the UITextView will set its `intrinsicContentSize` to match its text content. uiTextView.isScrollEnabled = false uiTextView.setContentHuggingPriority(.defaultLow, for: .vertical) uiTextView.setContentHuggingPriority(.defaultLow, for: .horizontal) uiTextView.setContentCompressionResistancePriority(.required, for: .vertical) uiTextView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) return uiTextView } func updateUIView(_ uiTextView: UITextView, context: Context) { uiTextView.attributedText = attributedString } } Used in a custom HTML SwiftUI View import SwiftUI struct HTML: View { private let bodyText: String init(_ bodyText: String) { self.bodyText = bodyText } var body: some View { AttributedText((try? NSAttributedString( data: """ <!doctype html> <html> <head> <meta charset="utf-8"> <style type="text/css"> body { font: -apple-system-body; color: white; } </style> </head> <body> \(bodyText) </body> </html> """.data(using: .utf8)!, options: [ .documentType: NSAttributedString.DocumentType.html, .characterEncoding: NSUTF8StringEncoding, ], documentAttributes: nil )) ?? NSAttributedString(string: bodyText)) } } Put together in a simple SwiftUI app import SwiftUI struct ContentView: View { var body: some View { NavigationStack { ScrollView { HTML(""" <p>This is a paragraph</p> <ul> <li>List item one</li> <li>List item two</li> </ul> """) } .navigationTitle("HTML in SwiftUI") } } } @main struct MyApp: App { var body: some Scene { WindowGroup { ContentView() } } } Now, when I build and run the simple SwiftUI app shown above, it renders just fine, but there is a lot of log entries similar to "=== AttributeGraph: cycle detected through attribute 24504 ===". In addition to that, the navigation title bugs out when I scroll up. It also seems like SwiftUI is not able to detect changes to the HTML View, and does not re-evaluate its body if I re-create HTML with a new bodyText (even though its structural identity is preserved). When I use Instruments to inspect SwiftUI View body invocations, I can see that initiating the inline HTML styled NSAttributedString in the HTML View's body takes several milliseconds (not too surprising as it calls into WebKit stuff?), resulting in HTML.body taking more than 15 milliseconds to complete. Which is a lot more than if i just instantiated a "pure" text string using e.g the NSAttributedString(string:) initialiser. The initial render also seem to call HTML.body twice, a second time after calling the body of some View labeled "RootModifier" (Maybe the invocation of HTML.body took too long, and SwiftUI tries again?). Now, I acknowledge that all these signs yell "do not call computational heavy stuff inside a View's body!", but still, I would love to understand why SwiftUI complains about cycles in its AttributeGraph (as I can't really see any), and why SwiftUI does not re-evaluate HTML's body if I re-create HTML with a new bodyText (as HTML's initialiser is clearly called with a new and different bodyText value). I could also just completely drop the custom HTML SwiftUI View, and just use the AttributedText UIViewRepresentable directly. And then fully manage instances of HTML styled NSAttributedStrings in my model layer (and not instantiate them as part of some custom SwiftUI View). But that would remove some of the abstraction and readability of having a dedicated SwiftUI View for rendering HTML. So any suggestions on how to create such an abstraction/SwiftUI View would be greatly appreciated as well!
Posted
by Smed1.
Last updated
.
Post not yet marked as solved
0 Replies
393 Views
I found an anomaly in the scrolling position when using Element.prototype.scrollBy to scroll DOM elements. For example, when using scrollBy(0, 20) to scroll the element, the scrollTop read immediately after the scroll is completed is the expected 20. However, after adding some delay, it becomes 40. It seems like after scrolling a distance of ‘a’, the scrollTop read after the delay becomes ‘2a’. Below is the minimal case I tried to write. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div id="wrapper" style="overflow-y: scroll;height: 50px;"> <div id="scroller" style="height: 200px;"> </div> </div> <script> const wrapper = document.getElementById('wrapper'); wrapper.scrollBy(0, 20) console.log(wrapper.scrollTop) // will output 20 setTimeout(() => { console.log(wrapper.scrollTop) // will output 40 }, 500) </script> </body> </html>
Posted
by cuppi.
Last updated
.
Post not yet marked as solved
0 Replies
365 Views
Wondering if anyone has had any luck with getting the geo-location while viewing a web page in mobile Safari on Watch OS? I've updated my phone and watch to the latest versions. The code I'm using is standard Javascript for geolocation such as navigator.geolocation.getCurrentPosition(showPosition, showPositionError); Works fine when I run it in Safari on my laptop, but when I try to run the same thing on apple watch in embedded web browser, get an "Access Denied" error, which would imply that I have some permission set wrong either on the watch or the paired iPhone. I've messed with many of those settings and nothing seems to be working. Wondering if it's stated somewhere that it simply won't work so I don't continue chasing my tail on something that was designed not to work.
Posted
by andersjj.
Last updated
.
Post not yet marked as solved
0 Replies
530 Views
In my PWA app, I utilize the getUserMedia() API for accessing the camera and also employ HTML audio tags to handle various types of media content. However, since updating to iOS 17, I've encountered an issue where, after granting permission for camera access, audio playback occurs through the earpiece instead of the media speaker. This problem is specific to iOS 17; earlier iOS versions work as expected. My app is developed using a stack that includes JavaScript, Angular, Ionic, HTML5, and CSS. Can you please provide guidance or a solution to address this issue and ensure that audio plays through the media speaker when using the camera on iOS 17?
Posted
by kekuuuuu.
Last updated
.
Post not yet marked as solved
0 Replies
556 Views
In My PWA app I am using camera of getUserMedia() and html audio tags, So In my app I am using videos audios and camera based on requirements, so When I have updated iOS17 I have stared facing below issue. When I am loading camera after premission given. my audios are playing in ear speaker and not in media speaker only for ios17, older ios versions it is working fine. I am using javascript, angular, ionic with html5 css for developing my app. Please provide solution.
Posted
by kekuuuuu.
Last updated
.