-
Notifications
You must be signed in to change notification settings - Fork 85
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
当代码注释中包含代码块的时候,将代码也翻译了,效果很不理想 #237
Labels
bug
Something isn't working
Comments
原始内容如下 //! Value must be a valid email address, supported `String`, and other types always return false.
//!
//! # Examples
//! ```
//! # use serde::Serialize;
//! # use valitron::{available::{Email, MessageKind}, Validatable, Validator};
//! #[derive(Serialize, Debug)]
//! struct Input {
//! email: String,
//! password: String,
//! }
//!
//! let input = Input {
//! email: String::from("user"),
//! password: String::default(),
//! };
//! let err = input
//! .validate(
//! Validator::new()
//! .rule("email", Email)
//! )
//! .unwrap_err();
//!
//! assert!(matches!(
//! err.get("email").unwrap()[0].kind(),
//! MessageKind::Email
//! ));
//!
//! let input = Input {
//! email: String::from("[email protected]"),
//! password: String::from("bar"),
//! };
//! input
//! .validate(
//! Validator::new()
//! .rule("email", Email)
//! )
//! .unwrap();
//! ```
rust代码的注释也可能是这种情况 /// ```
/// let a = "foo";
/// ```
我可以参与代码贡献,但是我现在看到代码里注释很少,如果可以的话,可以提供一些思路,或者方向,我自己完成这块的改进 |
收到,注释内的代码判断目前做的比较粗糙。只是简单判断了下,是否跳过翻译。 |
思路:在这里判断注释内是否包含代码,如何是原文显示还是跳过翻译:
|
奇怪的是,这个问题只出现了一次,后来再也没出现过,不知道如何复现问题,无从下手解决 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
截图是目前的效果,因为 rust 语言的注释中,可以包含代码,所以针对rust的代码块能不能做下区分呢,别翻译这块呢
The text was updated successfully, but these errors were encountered: