Code Monkey home page Code Monkey logo

githuber-md's Introduction

githuber-md's People

Contributors

a-mt avatar alpipego avatar bramus avatar bronya0 avatar hmaragy avatar howardlau1999 avatar jawngee avatar jeherve avatar jpsimkins avatar kasztof avatar lategege avatar martincz avatar mkmark avatar mvanholsteijn avatar nczz avatar nyx1197 avatar pluveto avatar razonyang avatar surkum avatar syhily avatar terrylinooo avatar xxnull-lsk avatar zxilly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

githuber-md's Issues

Wrong parse when input a charater <

When write a code as below

<pre><code id="example">
for (let i = 0; i < 4; i++) 
</code></pre>

The character "<" will parse as a "open tag" but not "less than", that will mess up next content.
I know that the markdown use "```" to parse <code> element, but sometimes we need special format to express other language code.
Please help!

[Enhancement] Add support for image alignment

Sometimes we want to align an image to the right or left of the text. This can be achieved by adding an image like so:

<img align="right" src="src-of-img>

Right now in order to achieve this, we need to input the tag and attributes manually. It would be great if the plugin had an option for it.

Gitbuber incorrectly reads Jetpack's settings

WP Gitbuber MD suggests that Jetpack's Markdown support should be disabled:

gitbubber-1

While it is already disabled:

gitbubber-2

I can see Gitbuber's nag screen every time, I login to my Wordpress even though I have disabled Jetpack's Markdown support weeks ago (when installing WP Gitbuber MD for the first time). Using WP Gitbuber 1.9.1.

Using katex inline

Recently I use the editor and mynote themes, it's awsome.
I have a question with build-in katex: the Code-Block Katex works fine, but how can I use it INLINE ?

Many Thanks.

Ellipsis disappears from posts after loading MD plugin

Hi Terry,

Not sure if this is a plugin issue but when I type an ellipsis, i.e. three dots ..., they appear in the middle of the line, not on the bottom. On posts that I wrote without your plugin enabled, they disappear entirely after loading your plugin.

Plugin doesn't properly install using composer and WordPress Packagist

I opened an issue on the wpackagist github page before I realized your plugin had a github page. You can see it here:
outlandishideas/wpackagist#294

In summary, I tried installing your plugin using composer and WordPress Packagist

"wpackagist-plugin/wp-githuber-md":"1.7.3"

It downloaded and appeared to install, but the list of plugins in the admin area didn't show your plugin, therefore I couldn't activate it. Here's the output of running composer update

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing wpackagist-plugin/wp-githuber-md (1.7.3): Downloading (100%)
Writing lock file
Generating autoload files

Thanks.

Per Post Enable/Disable of Markdown

I love Githuber-MD but I have a large existing website.

I would like to get started writing and converting to MD,
but that will take weeks or months, so I need a way to keep the editor switchable
between the Githuber and the default visual/text editor

That'd be awesome.

thanks so much

Escape < and > on markdown code

Setup: LiteSpeed Web Server, PHP 7.2, WordPress 5.1.1, GithuberMD 1.7.2, theme "Underscores.me".


Hello there,

First, thanks for your contribution to WordPress community. Your plugin is rock solid and the best editor I have ever used.

On the website I'm working on, we use tons of < html > tags and on the live preview, it's fine:
http://i.imgur.com/hD2cBVE.png

However, on the post_content, it's being saved as plain "<" instead of "&alt;"
http://i.imgur.com/Dm4PP4U.png

I do see some Issues report mentioning < and >, but none seem to be related to how the content is displayed on the page or saved on the database.

In my case, the theme does not filter the content of post_content, so the code is embedded on the page as a real html code:
http://i.imgur.com/HP24Pdv.png

I'm not sure if this is expected or if the theme is suppose to filter the html tags inside < code >. If these are the cases, please apologize for reporting incorrectly.

I tried with and without code syntax highlight module enable, tried to update the articles after the changes and the result is the same.

Any feedback would be appreciate. Again, I'm sorry if this is not plugin related and thanks for your time.

Have a nice day.

Regards,
Northon

图片粘贴不正常的问题

图片直接粘贴会报500错误,使用的是最新的1.9.0版本(直接从插件库装的也会出这个错误),不知道是不是我本地的问题。 开启了php错误日志发现是mime_content_type()这个函数没定义导致的错误。完整错误日志如下:

[23-Apr-2019 16:55:10 Asia/Shanghai] PHP Fatal error:  Uncaught Error: Call to undefined function Githuber\Controller\mime_content_type() in /www/mywebsite.com/wp-content/plugins/githuber-md-1.9.0/src/Controllers/ImagePaste.php:81
Stack trace:
#0 /www/mywebsite.com/wp-includes/class-wp-hook.php(286): Githuber\Controller\ImagePaste->admin_githuber_image_paste('')
#1 /www/mywebsite.com/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
#2 /www/mywebsite.com/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#3 /www/mywebsite.com/wp-admin/admin-ajax.php(167): do_action('wp_ajax_githube...')
#4 {main}
  thrown in /www/mywebsite.com/wp-content/plugins/githuber-md-1.9.0/src/Controllers/ImagePaste.php on line 81

因为用qq截图,默认是png格式的,所以直接把:

//$file_mimetype = mime_content_type( $file['tmp_name'] );

替换成了:

$file_mimetype = 'image/png';

就可以正常工作了。麻烦作者查看下,是程序的bug还是跟其他插件的兼容问题?

Can't paste /display images

I'm unable to insert images into pages with your plugin installed. If I add an image the traditional way, then activate your plugin and edit the page, the image won't display

Incorrect delimiter when underlining the same words

Gitbuber underlines the same words, it finds in each text:

wpg-1

Which is pretty cool feature (though you could think about giving an option to disable it).

The problem is that when determining "whole words" it does not use spaces (and other white characters) only as words delimiter, but all non-Latin characters instead:

wpg-2

Which produces a bit weird results.

Unable to set option to open link in new tab & option is lost when switching from Guttenberg editor to githuber

On the default Guttenberg editor, I am able to create hyperlinks that open in a new tab. On the markdown editor, this option doesn't exist.

When I create a hyperlink that opens in a new tab on the Guttenberg editor and preview it, it works as intended. When I switch to the Markdown editor and I preview the content, the links open in the same tab (they lose their open-in-a-new-tab property).

Trick to enable compatibility with Yoast SEO analysis

Thanks for this great plugin.

By default the Yoast SEO plugin's ( https://github.com/Yoast/wordpress-seo ) readability analysis and focus keyword analysis doesn't work with your markdown plugin. But Yoast does work with Jetpack's markdown plugin.

Here's a technique to make Yoast SEO's analysis work with your plugin. Just place the following in a must-use plugin to trick Yoast into thinking Jetpack Markdown is installed:

// Save the contents of the the following here: /wp-content/mu-plugins/fake-jetpack-markdown-existence.php
if (!class_exists('Jetpack')) { // Skip if Jetpack is really installed and activated.
    // Create a dummy Jetpack class.
    class Jetpack
    {
        public static function get_active_modules()
        {
            // Make the following happy:
            // /plugins/wordpress-seo/admin/formatter/class-metabox-formatter.php, WPSEO_Metabox_Formatter::is_markdown_enabled()
            return ['markdown'];
        }
    }
}

Of course, you can incorporate this into your own plugin so that it's compatible with Yoast.

You can probably go about this in a more surgical way, by checking if Jetpack is installed and if its markdown functionality is enabled. This'll allow your plugin, Yoast SEO, and Jetpack to coexist peacefully.

Thanks.

Missing parts of post's text when using WP Gitbuber MD

For some reason, for some blog posts WP Gitbuber MD is not displaying actual post's text or it is stripping parts of the text.

An example, how it should look and how it looks when WP Gitbuber MD is disabled:

gitbubber-3

And this is, how it looks when it is enabled:

gitbubber-4

The original post for reference. Using WP Gitbuber 1.9.1.

Please, consider this as high-priority. With missing text we cannot use your extension because we are not sure when it is going to delete parts of our blog posts from database, since it is not displaying the whole text when editing.

Unable to insert linked mini-image

In the newest version (1.8.5) it is not possible to insert images in smaller dimensions and a link to original image. You can only insert image without any link.

This fails:

1

This works:

2

Please, verify and fix this, because without ability to insert images into blog post I must disable your plugin. Thank you.

HTML 標籤被轉譯

Hello
無論有無開啟設定的「HTML 解碼」功能都會出現下列問題

後台:
image
前端:
image

這問題在麻煩協助確認~

Ignore Block

Is there away to have markdown parser ignore a block of text?

I wanting to use https://github.com/Kotlin/kotlin-playground-wp-plugin. I can place a [kotlin][\kotlin] to have that chunk of text run as Kotlin code. It works great, except

tags get inserted into the code.

Possible solution: do a regex replace "[kotlin].*[\kotlin]" with some random GUID, and then reinsert after the markdown parsing completes. To make generic, maybe the start and end tags could be configured.

I'm a developer, but not a WP developer. I would be willing to write the code if you can help point me in the correct direction.

Embedding github gists

Hi @terrylinooo ,

Great plugin! It's so easy to use! However, I was wondering if there is a feature to embed github gists? Or do you know of a plugin that work would simultaneously with this plugin? New to WordPress, so hope this makes sense.

Thanks, Kevin

Feature Request: Add option to select CPT for MarkDown

So far, I really like what I see here.

One feature that is missing is an ability to use this on CPTs. Ideally, an option in the settings to select any of the CPTs that are available or even a hook/filter.

I am posting this before I go through the code but this is a pretty important feature that I think would help drastically with this plugin.

Images are inserted in the end of document

The #44 was truly resolved (thank you!) and images are now correctly inserted into post's text -- both regular images and miniatures linked with actual image -- but they are inserted in the incorrect position in the editor.

Currently (1.9.1) when using Add image button, Markdown code for corresponding image is always inserted in the end of text (after last line) instead of being inserted at the current caret / cursor position.

This causes that you cannot insert images in desired place in the text. You always have to manually cut-and-paste them from the end to the required place.

Localization Issue

File: src\Controllers\Setting.php
Line: 703, 704

Original:
'_self' => 'Same window. (default)',
'_blank' => 'New window.',

Ideally:
'_self' => __( 'Same window. (default)', 'wp-githuber-md' ),
'_blank' => __( 'New window.', 'wp-githuber-md' ),

Line: 711

Original:
desc' => __( 'Allow using shortcode in Markdown text.') . '
' . __( 'Please understand that shortcode is processed to HTML by PHP, not JavaScript, therefore live-preview panel does not support it.', 'wp-githuber-md' ),

Ideally:
desc' => __( 'Allow using shortcode in Markdown text.', 'wp-githuber-md') . '
' . __( 'Please understand that shortcode is processed to HTML by PHP, not JavaScript, therefore live-preview panel does not support it.', 'wp-githuber-md' ),

githuber-md 啟用後,希望能保持「插入媒體」的功能。

有時候我們會需要圖片帶燈箱(lightbox)效果,就需要用到 image 上其它的 attribute。那麼就需要自行去寫 html,這時候如果能透過插入媒體的介面來轉入代碼,就會方便許多。因此,希望在打開「Insert Media」後,能夠把東西也放入 Markdown 的 Editor 裡。

Html 轉 Markdown 錯誤

網站資訊

WordPress 5.0.2
Nginx 1.15.7
PHP 7.2.13
外掛列表

文章內語法轉換錯誤

原始內容

<code>$_SERVER['SERVER_PORT'] = 80;</code>

轉換後

$_SERVER[\'SERVER_PORT\'] = 80;

Script 被洗掉

原始內容

<p><script src="https://gist.github.com/cras4202tw/80b2b53f9fa37d3223bde4fadcb873f7.js"></script></p>

轉換後


圖片轉換錯誤

原始內容

<p><img class="alignnone size-full wp-image-737" src="https://www.4rbj4.com/wp-content/uploads/2018/07/1530844867-a77a37c09dfb4ee38a29a8fa2249936b.png" alt="" width="820" height="187" /></p>

轉換後

![\"\"](\"https://www.4rbj4.com/wp-content/uploads/2018/07/1530844867-a77a37c09dfb4ee38a29a8fa2249936b.png\")

markdown 所見即所得的內容

<p><img src="\&quot;https://www.4rbj4.com/wp-content/uploads/2018/07/1530844867-a77a37c09dfb4ee38a29a8fa2249936b.png\&quot;" alt="\&quot;\&quot;" scale="0"></p>

截圖

原本內容

before

轉換後

after

一些问题

你好,自动保存功能对我来说比较重要。当我把插件中的 Disable Auto-save 和 HTML-to-Markdown都关掉后,如果此时将 Sync Scrolling 关掉,我发现 Live Preview 好像有点问题还有此时的自动保存貌似失效了。

Lost added contents when "Enable Markdown" is chanaged from Disable to Enable

The contents added when "Enable Markdown" is Enabled are lost after it is changed to Disable.

Steps to Reproduce

  1. Set "Enable Markdown" to Enable, and write a post and save it.
  2. Change "Enable Markdown" to Disable
  3. Change the post, and save it.
  4. Set "Enable Markdown" to Enable.

After step 4, the contents would be the one at step 1.

Bulk HTML to Markdown Converter

Hello there,

This is a suggestion, not an issue, but I don't see a better place to add. Currently I'm working with 1k articles imported via CSV and they were originally written with HTML tags, so I'm using the HTML -> MD converter in order to adjust the articles.

Would it be possible to add in the future a feature to allow converting older posts into MD format in bulk?

By the way, thanks for the help on #31, it's working as expected now.

Have a nice day!

Regards,
Northon

两个独立的行间代码块里的*会使之间的文字变斜体

Hello,感谢你开发出这么棒的 MD 插件,功能完善而稳定,我在发现它之前都放弃在 Wordpress 直接用 MD 写了。不过,我在使用时发现,如果同一行的两个行间代码块中都有一个星号「*」,那么两个星号之间的文字会变成斜体。

例如:

一个 `*a` 另一个 `*b`

这样的一行的实际效果是「a` 另一个 」会以斜体显示。而不是

一个 *a 另一个 *b

请问可以修复这个问题吗?

另外,我发现在在启用了代码高亮之后,模组 - 代码高亮 - 布景主题 中设置的主题不会影响到行间代码块的显示情况。请问这是我使用的主题(Twenty Sixteen)的原因吗,我有什么办法让行间代码块同样使用在插件里设定的主题吗?

多谢~

When I am trying to restore previous version of a post there are a few errors

Warning: Creating default object from empty value in /home/wojcieh1/public_html/domain.com/wp-content/plugins/wp-githuber-md/src/Controllers/Markdown.php on line 906

Warning: Cannot modify header information - headers already sent by (output started at /home/wojcieh1/public_html/domain.com/wp-content/plugins/wp-githuber-md/src/Controllers/Markdown.php:906) in /home/wojcieh1/public_html/domain.com/wp-includes/pluggable.php on line 1223

Is it possible to parse &lt; and &gt; ?

嗨!不好意思,冒昧請問一下。

因為目前在 Wordpress 的文章中,如果要呈現 HTML 等語法需要做字元轉換才能正常顯示 < and > ,不知未來是否有可能在編輯器中新增自動轉換的功能。

謝謝

Live Preview shows an extra space after straight single quotes

First of all, thanks for this wonderful plugin.

Second, when I use straight single quotes ('), the live preview shows an extra space after the quote.

So if I type "here's" in the editor it will show "here' s" in the live preview. When I publish the post the extra space disappears. It's a minor annoyance but it would be great if it could be fixed.

Test case:

  1. Create a new post on a Wordpress site with the plugin installed.
  2. Type "here's" in the editor.
    The Live Preview shows "here' s"

An issue on footnotes, and others

Hi, I just used your great plugin on Wordpress. Thank you for developing it.
But I've found an issue on footnotes. I wrote the following:

ABCD1efghijklmnopqrstuvwxyz.
abcd2.

Then, the published page gave me:
fnts

I don't know if it's just me.


And these are others. Supports for the following would be nice.

  1. How about adding Bigfoot.js to this plugin? I think it's simple to embed and pretty good for viewers to see the footnotes. Or, there should be another way to do it. A markdown editor (not Wordpress plugin) called Typora provides live previews for footnotes using hover popups.
  2. Sometimes I'd like to use the mhchem extension with KaTeX. I wish there would be an option about using such extensions per page or post.

Footnotes

  1. First note

  2. Second note

[Feature Request] Override cmd + B default behavior on Firefox

Browser: Firefox
OS: Mac

What I want to happen:
When editing a post, I want to be able to use the "cmd + B" shortcut to make the selected text bold.

What actually happens:
Firefox's Bookmark Manager opens.

What needs to change:
The plugin should override Firefox's shortcut just like the Guttenberg editor does.

githuber-md crashed

![image](https://user-images.githubusercontent.com/7582298/54011959-55700e00-41af-11e9-8b10-3da7be4a455b.png

content in log: [08-Mar-2019 06:32:55 UTC] PHP Fatal error: Call to undefined function mb_convert_encoding() in /var/www/wordpress/wp-content/plugins/wp-githuber-md/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 468

It seems that mb_convert_encoding() is undefined, but the first time I tried it, nothing wrong with the plugin. What Can i do with this message?

Release items: v1.6.2

Feature request #16

Adding a new setting option in ImagePaste module.

image

Feature request #17

Adding new option when using Add media -> Insert to post that allows user insert HTML into post.
This option only works when HTML Decode is on.

image

Beautify Markdown switcher

image

Fix issue #15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.