Settings - MD Editor Improvements

The WMD Editor enhancement works with AnswerHub version 2.8+.

Overview

We have improved the WMD Editor with the following updates:

  • The ability to cycle through heading levels by pressing the HEADING button.

    • We now support Drag and Drop, creating a target area where the user selects the graphic widget.
    • We now support the ability to copy and paste an image - users may select, paste, or use keyboard shortcuts.
    • Ensure you have applied existing attachment type checks against the list of allowable image types stored in the admin. To do so, perform the following steps:
      1. Log in to AnswerHub.
      2. Navigate to the Administration Dashboard.
      3. Navigate to Content > Node Structure > Attachment Settings.
      4. Check the list of Image Authorized Types against the list of Authorized Types.
  • The ability to use ``` (triple backticks) for code blocks.

    • AnwerHub now allows users to utilize either four spaces before each line or triple back-ticks in the beginning and the end as valid markers for code blocks. For example:

In addition, the following enhancement applies to AnswerHub in general:

  • Displaying line numbers on code blocks.
    • In the current functionality, clicking the CODE button brings up a window to enter code. The user then pastes in the code and clicks OK and the editor adds the code in the post. The user can check the code by clicking the PREVIEW button and see the line numbers appear in multiples of 5. This current line numbering system of 5’s is not desirable.
    • With this enhancement, the admin will have the choice to enable line numbers to display or have the line numbers hidden. When the admin enables line numbering, line numbers will display and in multiples of one’s. Previously posted content that displayed by 5’s now renders by 1’s or gets suppressed if the admin turns the feature off.

📘

NOTE:

This feature ships with line numbering turned on. See below to disable or re-enable this feature.

These updates impact the following content types:

  • Articles
  • Ideas
  • Questions
  • Answers
  • Comments

Requirements

Must have version 2.8 or higher.

Feature Overview

Admin Interactions with WMD Editor Improvements

You can now do the following:

  • Decide whether pasted code blocks display line numbers on the code, regardless of which editor you select.

Community User Interactions with WMD Editor Improvements

When using the WMD editor:

  • Create multi-lined bulleted and numbered list and blockquote
  • Cycle through heading levels using the HEADING button
  • Create a code block using ```
  • Drag and Drop image

Please refer to the Overview for more detail.

How to Enable This Functionality

To display line numbers on code blocks, do the following:

  1. Log In to AnswerHub
    First, you will need to log in to your instance of AnswerHub.
  1. Navigate to the Administration Dashboard
    Navigate to your avatar and select Administration in the drop-down.
  1. Navigation to the General Site Settings
    Navigate to Site > General > Settings.
  1. Toggle the feature on/off
    Toggle the feature on/off by selecting/deselecting the box next to the Display line numbers on code blocks field.

Results

Without this functionality enabled, the following displays:

When you enable this functionality, the following displays:


What’s Next
Did this page help you?