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
485 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
by
Post not yet marked as solved
0 Replies
401 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
Post marked as solved
1 Replies
503 Views
Basic HTML strings do not display correctly on macOS Sonoma, I am wondering if there is an alternative technique that can be utilized. There was a minor change in macOS 14.2, which fixed some cases but made others much worse. Consider the following code: override func viewDidLoad() { super.viewDidLoad() let html = """ <table width="100%" border="1" style="color: white"> <tr> <td align="left">Left</td> <td align="right">Right</td> </tr> </table> """ let data = Data(html.utf8) let definition = try! NSAttributedString(data: data, options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding: NSNumber(value: String.Encoding.utf8.rawValue)], documentAttributes: nil) let frameRect = NSRect(x: 100, y: 0, width: 300, height: 200) let textView = NSTextView(frame: frameRect) textView.textStorage?.setAttributedString(definition) textView.backgroundColor = .clear view.addSubview(textView) } On macOS 14 (23A5312d) it looks like this (FB13170237): On macOS 14.2 (23C64) it looks like this (FB13465833):
Posted
by
Post not yet marked as solved
0 Replies
682 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
Post not yet marked as solved
9 Replies
796 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
by
Post marked as solved
2 Replies
624 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
Post not yet marked as solved
0 Replies
454 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
by
Post not yet marked as solved
1 Replies
548 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
Post marked as solved
2 Replies
605 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
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
Post not yet marked as solved
0 Replies
453 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
by
Post marked as solved
6 Replies
763 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
Post not yet marked as solved
0 Replies
402 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
Post not yet marked as solved
0 Replies
376 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
Post not yet marked as solved
0 Replies
545 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
Post not yet marked as solved
0 Replies
567 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
Post not yet marked as solved
0 Replies
446 Views
Hello! I am someone who creates websites. When I click a link within an iframe, the screen briefly turns white. (This link navigates within the iframe, and the parent frame does not navigate.) I haven't specified any background-color or styling within the iframe, including the body. However, it turns briefly white during the transition, probably due to a rendering issue. This issue doesn't occur on other devices (android). Can this be resolved with CSS, or is it a bug? PC MAC OS / 13.4 (22F66) Safari / 16.5 (18615.2.9.11.4) iPhone IOS / 16.1.1 Safari / unknown
Posted
by