Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-75963

Add "Code highlighter" filter to display properly coding style for Tiny

    XMLWordPrintable

Details

    • MOODLE_401_STABLE
    • MOODLE_403_STABLE
    • MDL-75963-master
    • Hide
      1. Log in as admin.
      2. Navigate to Manage Filters in Site Admin
      3. Verify that you see "Code Highlighter" in the filter table, and enable the filter.
      4. Choose TinyMCE as your text editor by navigating to Editor Preferences.
      5. Navigate to Edit Profile.
      6. In the description input, fill in the text "This code text should be red".
      7. Block the text. Click Format on the menu and select Code.
      8. Verify that the text colour turns red.
      9. Click the Update Profile button.
      10. Navigate to your Profile page.
      11. Verify that the text is displayed in the same style as the TinyMCE editor.
      12. Navigate to Edit Profile.
      13. Create a new line at the bottom of the previous text in the description input.
      14. Click Insert on the menu and select Code Sample.
      15. Select "PHP" in the language dropdown.
      16. In the code view, fill in the text below:

        <?php
        defined('MOODLE_INTERNAL') || die();
        ?>

      17. Click the Save button.
      18. Verify if you see the code written with the code highlighter display.
      19. Click the Update Profile button.
      20. Navigate to your Profile page.
      21. Verify that the profile description has the text "This code text should be red" and the PHP line of codes with the same look/style as the TinyMCE editor.
      Show
      Log in as admin. Navigate to Manage Filters in Site Admin Verify that you see "Code Highlighter" in the filter table, and enable the filter. Choose TinyMCE as your text editor by navigating to Editor Preferences. Navigate to Edit Profile. In the description input, fill in the text "This code text should be red". Block the text. Click Format on the menu and select Code. Verify that the text colour turns red. Click the Update Profile button. Navigate to your Profile page. Verify that the text is displayed in the same style as the TinyMCE editor. Navigate to Edit Profile. Create a new line at the bottom of the previous text in the description input. Click Insert on the menu and select Code Sample. Select "PHP" in the language dropdown. In the code view, fill in the text below: <?php defined( 'MOODLE_INTERNAL' ) || die(); ?> Click the Save button. Verify if you see the code written with the code highlighter display. Click the Update Profile button. Navigate to your Profile page. Verify that the profile description has the text "This code text should be red" and the PHP line of codes with the same look/style as the TinyMCE editor.
    • 6
    • Team Hedgehog Sprint 1 review, Team Hedgehog Sprint 2.1, Team Hedgehog Sprint 2.2, Team Hedgehog 2023 Sprint 1.3, Team Hedgehog 2023 Sprint 1.4, Team Hedgehog 2023 Sprint 2.0, Team Hedgehog 2023 Sprint 2.1

    Description

      Tiny creates some pretty content, including well-styled code samples.

      Unfortunately the styling is lost during display because we don't have any of these styles applied in the theme itself. We need to isolate any missing styles, and define them in Boost too.

      Note: These must be defined in theme_boost and not in Tiny, because we should not lose the styling of content just because the editor that wrote them has been removed years later.

      Attachments

        Issue Links

          Activity

            People

              meirza.arson@moodle.com Meirza
              dobedobedoh Andrew Lyons
              Raquel Ortega Raquel Ortega
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Ron Carl Alfon Yu Ron Carl Alfon Yu
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 4 hours, 35 minutes
                  1w 4h 35m

                  Clockify

                    Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.