Skip to content

Phone number hyperlink not recognised as a 'tel:'. 'Showing 'https://' insteadΒ #18156

@alex-richards-axis

Description

@alex-richards-axis

πŸ“ Provide detailed reproduction steps (if any)

  1. Enter a phone number into CKEditor
  2. Select the phone number
  3. Add a hyperlink

βœ”οΈ Expected result

The hyperlink should show 'tel:1234567890'

❌ Actual result

The hyperlink shows 'https://' instead of 'tel:'

❓ Possible solution

Change the CKEditor regex to recognise a telephone number hyperlink

πŸ“ƒ Other details

  • Browser: Chrome
  • OS: Windows 10 Enterprise
  • CKEditor 5

Code:

ClassicEditor
    .create(input[0], {
        plugins: [ClassicEditor, Essentials, Paragraph, Image, ImageUpload, ImageResizeEditing, ImageResizeHandles, HtmlEmbed, Link],
        extraPlugins: editorExtraPlugins,
        toolbar: toolbar,
        link: {
            defaultProtocol: 'https://',
            decorators: {
                allowedProtocols: ['https?', 'tel', 'sms', 'mailto'],
                safeUrlProtocols: 'https?|ftps?|mailto|tel',
                toggleDownloadable: {
                    mode: 'manual',
                    label: 'Downloadable',
                    attributes: {
                        download: 'file'
                    }
                },
                openInNewTab: {
                    mode: 'manual',
                    label: 'Open in a new tab',
                    attributes: {
                        target: '_blank',
                        rel: 'noopener noreferrer'
                    }
                }
            }
        }
    })

If you'd like to see this fixed sooner, add a πŸ‘ reaction to this post.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugThis issue reports a buggy (incorrect) behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions