Skip to content

!!! Bug: code format is not correct. Useless html tag is shown !!! #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kgfly opened this issue Sep 29, 2019 · 1 comment
Closed

!!! Bug: code format is not correct. Useless html tag is shown !!! #183

kgfly opened this issue Sep 29, 2019 · 1 comment

Comments

@kgfly
Copy link

kgfly commented Sep 29, 2019

Problem Summary

The downloaded code format is not correct. Useless html tag is shown

How to reproduce

I just reinstalled latest 2.6.2 because submit does not work in the old version.

cd
rm -fr .npm .nvm

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
$ source ~/.bashrc
$ nvm install --lts
$ npm install -g leetcode-cli
$ leetcode version

lee show 1 -gx -l python3

Observed:
In 1.two-sum.py

#
# @lc app=leetcode id=1 lang=python3
#
# [1] Two Sum
#
# https://leetcode.com/problems/two-sum/description/
#
# algorithms
# Easy (44.54%)
# Total Accepted:    2.1M
# Total Submissions: 4.8M
# Testcase Example:  '[2,7,11,15]\n9'
#
# <p>Given an array of integers, return <strong>indices</strong> of the two
# numbers such that they add up to a specific target.</p>
# 
# <p>You may assume that each input would have
# <strong><em>exactly</em></strong> one solution, and you may not use the
# <em>same</em> element twice.</p>
# 
# <p><strong>Example:</strong></p>
# 
# <pre>
# Given nums = [2, 7, 11, 15], target = 9,
# 
# Because nums[<strong>0</strong>] + nums[<strong>1</strong>] = 2 + 7 = 9,
# return [<strong>0</strong>, <strong>1</strong>].
# </pre>
# 
#
class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:

Expected:
I've an old copy downloaded by old version:


#
# @lc app=leetcode id=1 lang=python3
#
# [1] Two Sum
#
# https://leetcode.com/problems/two-sum/description/
#
# algorithms
# Easy (42.32%)
# Total Accepted:    1.6M
# Total Submissions: 3.7M
# Testcase Example:  '[2,7,11,15]\n9'
#
# Given an array of integers, return indices of the two numbers such that they
# add up to a specific target.
# 
# You may assume that each input would have exactly one solution, and you may
# not use the same element twice.
# 
# Example:
# 
# 
# Given nums = [2, 7, 11, 15], target = 9,
# 
# Because nums[0] + nums[1] = 2 + 7 = 9,
# return [0, 1].
# 
# 
# 
# 
#

In the newer version, lots of useless html, such as <p> <strong> ... is showing. Very annoying.

Environment

  • leetcode-cli version:
  • OS version: Ubuntu 18 LTS
  • Node version: v10.16.3
  • Npm version: 6.9.0

Thanks.

@kgfly kgfly changed the title !!! Bug in latest 2.6.2: code format is not correct. Useless html tag is shown !!! !!! Bug: code format is not correct. Useless html tag is shown !!! Sep 29, 2019
@kgfly
Copy link
Author

kgfly commented Sep 29, 2019

"rm -fr ~/.lc" solve the issue.

I think the issue is caused by "--no-color" setting per the suggestion from this thread #179

Close it for now.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant